db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Antwort: connection recovery
Date Wed, 20 Apr 2005 07:50:16 GMT


looking in the code, Torque.shutdown() does not close the connection pools
it opened at init(). You would have to shutdown the pool manually.
Hoverer, it is not easy to do this. Currently, I found no way how you could
retrieve the Connection Pool from Torque, because the method
TorqueInstance.getDataSourceFactory(String), which is used by Torque to get
the data source, is protected.

Either you find a way to configure the pool such that it tests connections
before it hands them out (SharedPoolDataSource can do it, look at the dbcp
documentation in jakarta commons), or you have to get Torque's source, make
TorqueInstance.getDataSourceFactory(String) public, and rebuild it.

This is not the way Torque should behave in a case of shutdown. I have
added a bug report in scarab about this.


"Jinsong Hu" <jinsong_hu@hotmail.com> schrieb am 20.04.2005 07:41:23:

> Hi, There,
>   I have been using torque in our project.I am trying to get this to
> 1. use Torque.init();
> 2. use the torque connections for various tasks.
> 3. shutdown the database manually. at this stage, no connection can be
> 4. start database manually, and in the java code, try to use db
> connection again.
> what happens is that for oracle database, in step 4, the connection
> will work, and I
> can continue to select/insert data without special effort.
> but if the database is ms sql, then the connections will always
> fail, saying broken pipe.
> I have to restart my application to get connection work again.
> I wonder if in torque there is a method to ask the torque to re-
> establish db connection.
> it looks trying shutdown() then init() doesn't do the trick.
> I am using torque 3.1
> Jinsong

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

View raw message