I've got a DBCP connection pool in Tomcat. However , once the connection sheds briefly the appliction is damaged because DBCP will not attempt to reunite again later when there's an association. Can One get DBCP to reunite instantly?
autoReconnect=true get the job done when put into the bond string?
jdbc:mysql://localhost:3306/appfuse?autoReconnect=true -> jdbc:db2:appfuse
You will find two ways to "solve" this, though have some issues:
Use a "validationQuery" (see below) to possess a test query run prior to going (generally something similar to 'select 1 from dual' which is accustomed to test connections before/once you get/provide them with towards the pool. This adds an additional call per connection request in the pool. See: http://wiki.apache.org/commons/DBCP
Rather than carrying this out per query, you could have the idleEvictorThread get it done by setting testWhileIdle, though in certain versions that thread may cause deadlocking under high-load. See: http://commons.apache.org/dbcp/configuration.html for additional particulars on might other available choices
Don't believe DBCP does that, but BoneCP (http://jolbox.com) could be set up to instantly replay any transactions once the DB or network goes lower. It's totally transparent for your application.