What is tricky about setting up a datasource in struts-config for deployment? The advantage is that you don't need to worry about container specific datasource setup.

David






From: "mech" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: db connection pool question
Date: Wed, 22 Jan 2003 20:09:55 +0100

I can't tell for Oracle, but for MySQL and the Struts Connection Pool
you have to set some kind of "autoReconnect=true" for your connection
url setup. Otherwise your connection pool will contain only stale
connections after a certain timeout.
MySQL kicked me out after 8 hours of inactivity.
Without autoreconnect you will just pick a "dead" connection out of this
pool, get an exception, most likely even close the broken connection in
your finally-block and put it back into the pool. Next time you grab
another dead connection and so on and forth.

By the way... Are the certain pro and cons for the struts connection
pool vs. the tomcat datasource connection pool?
As far as I know the tomcat connection pool works only via jndi setup
whereas struts utilized the "oldfashioned" way. And moreover you have to
set it up in struts-config.xml which is a bit tricky for deployment.

Michael

> -----Original Message-----
> From: Raible, Matt [mailto:[EMAIL PROTECTED]]
> Sent: Mittwoch, 22. Januar 2003 17:18
> To: 'Struts Users Mailing List'
> Subject: RE: db connection pool question
>
>
> After waiting 24 hours, I'm still experiencing the same
> problem with Oracle and a connection pool (DBCP) in Tomcat.
> I guess I'll try configuring Oracle's connection pool??
>
> Matt
>
> > -----Original Message-----
> > From: Raible, Matt
> > Sent: Tuesday, January 21, 2003 8:22 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: db connection pool question
> >
> >
> > Actually, the solution that I had only works for MySQL. I'm
> > having the same problem with Oracle. Funny - I just posted a
> > message to the commons-user group asking this same question.
> > I'll try adding the validationQuery parameter:
> >
> > <parameter>
> > <name>validationQuery</name>
> > <value>SELECT 'CRAP' FROM DUAL</value> </parameter>
> >
> > Thanks,
> >
> > Matt
> >
> > > -----Original Message-----
> > > From: Pani, Gourav [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, January 21, 2003 7:58 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: RE: db connection pool question
> > >
> > >
> > > please look at the thread with subject "Problem with JDBC
> & Struts
> > > Connection Pool (possible to recon nect?)". Matt Raible had a
> > > solution to that by setting autoReconnect=true
> > >
> > > -----Original Message-----
> > > From: david chan [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, January 21, 2003 9:56 AM
> > > To: Struts Users Mailing List
> > > Subject: db connection pool question
> > >
> > >
> > > Hi,
> > > I am using a connection pool from
> > > org.apache.commons.dbcp.BasicDataSourceFactory and the driver is
> > > oracle.jdbc.driver.OracleDriver. It works great until if
> the server
> > > idle for a few days, then the connection object seems broken with
> > > this error: ==== begin error mesg ===
> > > java.sql.SQLException: Io exception: Software caused
> > > connection abort: socket wr
> > > ite error at
> > > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
> > > at
> > > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
> > > at
> > > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
> > > at
> > >
> oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:417)
> > > at
> > >
> oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:432)
> > > at
> > >
> >
> oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedState
> > > ment.java:182) at
> > >
> >
> oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
> > > nection.java:602) at
> > >
> >
> oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
> > > .java:538) at
> > > org.apache.commons.dbcp.DelegatingConnection.prepareStatement(
> > > DelegatingConn
> > > ection.java:197)
> > > ...
> > > ===== end of error mesg ====
> > >
> > > What happen and how can I prevent this?
> > > Thanks.
> > > David
> > >
> > >
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > > http://mailplus.yahoo.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to