On Tue, 2012-01-03 at 10:47 -0800, Chema wrote:
> > But in my application I have context.xml with following
> >
> > <Context antiJARLocking="true" path="/myApp">
> > <Resource auth="Container"
> > driverClassName="oracle.jdbc.driver.OracleDriver"
> > maxActive="20"
> > maxIdle="10"
> > maxWait="-1"
> > name="jdbc/myName"
> > password="myPassword"
> > type="javax.sql.DataSource"
> > url="jdbc:oracle:thin:@//localhost:8080/MYDBS"
> > username="myUsername"
> > />
> > </Context>
>
> Well, you can use validationQuery parameter with "SELECT 1 FROM
> DUAL;".
+1
Try adding validationQuery="SELECT 1 FROM DUAL" and testOnBorrow="true".
When you restart the DB, it's going to disconnect all of the connections
in your pool. If you add a validation query and one of the "testOn*"
options (testOnBorrow is my personal favorite) then the pool will catch
the bad connections, remove them and assuming your DB is back online,
create new ones.
Dan
|