I need some help on how to refresh DB connection using DBCP. We have a web application 
built on Struts running on Tomcat 4.1.18 and talking to a AS400 database.  We use 
commons DBCP for datasoures.
 
Our database goes down every morning at 5 AM for maintenanace because of which  
Tomcat/DBCP loses its connection. When I come in the morning and try to access the app 
,I usually get a connection exception because datasource.getConnection() craps out. I 
usually restart Tomcat to refresh all connections ( the project is still under 
development and hence I get away with it).
 
Is there a parameter setting by which I can ask DBCP to see if the connection is stale 
(like in the case of a DB shutdown) and if so release all connections or even better 
try 'n' times to refresh  before releasing them?
 
Intuitively I thought the 'minIdle=0' wud do the trick but it is set to zero by 
default anyway. Will setting removeAbandoned to true help my cause?
 
TIA.
Swami
 
 


---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Reply via email to