You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Campanella Matteo <ma...@sisal.it> on 2006/12/19 21:44:56 UTC

dbcp exception on dead network

Hello, I would like to use DBCP in an enterprise application I am working
on.
What I need though is an exception to be raised in case I get connectivity
problem with the database, as for example if my oracle get disconnected from
the network.

I prepared a testbed like this: I run my application for a while, getting
the pool populated of connections and then I use iptables on the server
running tomcat to reject all incoming and outgoing traffic from/to the db -
at this point I call a servlet that uses a connection from the pool to do
query; using the basic setting of dbcp, the query hangs indefinitely, while
I would need a behaviour so that after a timeout an exception is reported to
the application.

Is this possible with dbcp?

thanks in advance for the help
best regards
Matteo

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE : dbcp exception on dead network

Posted by fo...@bell.ca.
Hi Matteo,

I've been having the same issue. Recently Oracle Driver 10.2+ let you set oracle.jdbc.ReadTimeout as a connectionProperty. You must absolutely use the thin driver for this to work. (I tested successfully with 10.2.0.3-1).

This solves the problem for a dead network and pooled connection with oracle thin driver.

Pierre Fortin 


-----Message d'origine-----
De : Campanella Matteo [mailto:matteo.campanella.pss@sisal.it] 
Envoyé : 19 décembre 2006 15:45
À : 'commons-user@jakarta.apache.org'
Objet : dbcp exception on dead network

Hello, I would like to use DBCP in an enterprise application I am working
on.
What I need though is an exception to be raised in case I get connectivity
problem with the database, as for example if my oracle get disconnected from
the network.

I prepared a testbed like this: I run my application for a while, getting
the pool populated of connections and then I use iptables on the server
running tomcat to reject all incoming and outgoing traffic from/to the db -
at this point I call a servlet that uses a connection from the pool to do
query; using the basic setting of dbcp, the query hangs indefinitely, while
I would need a behaviour so that after a timeout an exception is reported to
the application.

Is this possible with dbcp?

thanks in advance for the help
best regards
Matteo

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org