problem with dbcp and database restart
hi all, I have a problem with my configured datasource using dbcp. I have posted this question to tomcat user list in vain... Maybe some struts user could help. I've configured my dbcp connection pool in Tomcat 4.1.18 server.xml file. here is an extract of it ResourceParams name=jdbc/intranetMail parameternameusername/namevalueXXX/value/parameter parameternamepassword/namevalueXXX/value/parameter parameternamedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value/parameter parameternameurl/name valuejdbc:sybase:Tds:s198000SGD1:5000/intranet_mail/value/parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter Everything works fine. But when our database server is restarted, I have to restart Tomcat in order to aquire connection to my defined pool. I wonder if there is a manner to avoid restarting Tomcat when the database server is restarted. I have added the parameters below to my pool config. parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter I recognize ,I've added that quite blindly. Can someone confirm me if this is a cure to my problem ? any suggestion is greatly appreciated. Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender.
RE: problem with dbcp and database restart
Try the validationQuery tag so that the pool validates the connection before returning it to your code. ^^ Ed Yu, Senior Solutions Architect (IBM Certified AIX Administrator), Advanced Solutions Group, Physics Dept., University of South Carolina, Columbia, SC 29208 Office (803)777-8831, FAX (803)777-8833, Email [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 10:36 AM To: [EMAIL PROTECTED] Subject: problem with dbcp and database restart hi all, I have a problem with my configured datasource using dbcp. I have posted this question to tomcat user list in vain... Maybe some struts user could help. I've configured my dbcp connection pool in Tomcat 4.1.18 server.xml file. here is an extract of it ResourceParams name=jdbc/intranetMail parameternameusername/namevalueXXX/value/parameter parameternamepassword/namevalueXXX/value/parameter parameternamedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value/parameter parameternameurl/name valuejdbc:sybase:Tds:s198000SGD1:5000/intranet_mail/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter Everything works fine. But when our database server is restarted, I have to restart Tomcat in order to aquire connection to my defined pool. I wonder if there is a manner to avoid restarting Tomcat when the database server is restarted. I have added the parameters below to my pool config. parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter I recognize ,I've added that quite blindly. Can someone confirm me if this is a cure to my problem ? any suggestion is greatly appreciated. Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with dbcp and database restart
Meissa, When your database restarts, all your dbcp connections (in the pool) become staled connection. In order to resolve this problem, dbcp needs to do a ping to database server to make the connection is still up before giving to your app. Looking into dbcp configuration doc, it should have a param you can setup (something like QueryString) where it should be a select statement to a database table. You many need to setup a dummy table just for this purpose. Hope this helps. -Dan - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 7:36 AM Subject: problem with dbcp and database restart hi all, I have a problem with my configured datasource using dbcp. I have posted this question to tomcat user list in vain... Maybe some struts user could help. I've configured my dbcp connection pool in Tomcat 4.1.18 server.xml file. here is an extract of it ResourceParams name=jdbc/intranetMail parameternameusername/namevalueXXX/value/parameter parameternamepassword/namevalueXXX/value/parameter parameternamedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value/parameter parameternameurl/name valuejdbc:sybase:Tds:s198000SGD1:5000/intranet_mail/value/parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter Everything works fine. But when our database server is restarted, I have to restart Tomcat in order to aquire connection to my defined pool. I wonder if there is a manner to avoid restarting Tomcat when the database server is restarted. I have added the parameters below to my pool config. parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter I recognize ,I've added that quite blindly. Can someone confirm me if this is a cure to my problem ? any suggestion is greatly appreciated. Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]