commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryunix <budianto.chu...@gmail.com>
Subject Using DBCP with Hibernate - How to reconnect if the poolable connection is closed
Date Fri, 17 Apr 2009 18:07:15 GMT

Dear All,
we have an application which using hibernate with DBCP. 
and the application will access the database using hibernate session which
obtain the connection from the dbcp pool. The application will provide
webservices to be used by other application.

In some cases where the 'poolable connection' obtained by the hibernate
session is closed, our application will throw error saying the connection is
closed to the webservice client, and this error will only occur at that
particular web service call. At the next call, the webservice can return
result to the caller successfully.

To prevent the error, we had added an intermediate 'loop' function to test
the connection obtained by the session, if the connection (poolable
connection) is closed, we will issue conn.close() and release the session .
However, it seems that the connection obtained through
session.getConnection() at every loop is always the same, and hence would
have the same 'connection is closed' issue.

May I know if there is any way for me to force the session.getConnection to
return me a new 'valid' connection?

Thanks guys in advance

-- 
View this message in context: http://www.nabble.com/Using-DBCP-with-Hibernate---How-to-reconnect-if-the-poolable-connection-is-closed-tp23102913p23102913.html
Sent from the Commons - User mailing list archive at Nabble.com.


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


Mime
View raw message