I've read all the replies to my question and it sounds like the solution I implemented may just be a reasonable solution. ???
I did want to try applying a validation query to see what kind of results I would have. But, I was unable to apply a validation query because my database is Cobol DB2. The only way I can access Cobol DB2 is by calling a stored procedure. Eve ----- Original Message ----- From: "Stephen Westbom" <[EMAIL PROTECTED]> To: "Jakarta Commons Users List" <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 2:58 PM Subject: RE: [DBCP] Connections Die > Probably you are right. Sybase sells such a product for automated failover to > a hot database. > > I guess we just destroy the connection in the application code and retry. > -------------------------------------------------------------------------- > > > > > > > > > > Reference: Tomcat 4.1.18 > > > > > My dbcp goes dead at times. > > > > > My application on Tomcat is on one box and my DB2 database is on another > > > > > box. If the network goes down for a brief period or the database is > > > > > bounced, my dbcp no longer works and I receive an SQLException from my > > > > > application running on Tomcat. > > > > > > > > > > So, here is my fix to refresh the connection pool. When ever I receive an > > > > > SQLException, I run the following once: > > > > > > > > > > import javax.sql.DataSource; > > > > > import org.apache.commons.dbcp.BasicDataSource; > > > > > ....... > > > > > BasicDataSource bds = (BasicDataSource)myDataSource; > > > > > bds.close(); > > > > > > > > > > I tested this and it seems to solve the problem. The only thing that I > > > > do not like about this solution is that the java code in my app now includes > > > > a reference to the DBCP java class. But that's OK. I can live with > > that. My question is, is this solution OK or is there a better recommendation > > to refresh the dbcp? > > > > > > > > > > Thanks > > > > > Eve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
