I've searched the archives so forgive me if this has already been discussed.
I am running Torque with Resin. Everything runs beautifully but I have a weird case in which the retrieved connection from the pool is sometimes null. It always occurs when the app has been idle for some time (20 minutes or so) and it never occurs twice in a row. For instance, if the app has been idle for 20 minutes (with no requests from the db) and I click on a link that does a select I get the exception: java.lang.NullPointerException: Connection object was null. This could be due to a misconfiguration of the DataSourceFactory. Check the logs and Torque.properties to better determine the cause. Clicking the link just once more or hitting refresh does not result in any exception and everything functions properly. You can do all kinds of database activity after the one exception and never get the exception again. The null connection object after an idle period is always consistent. I can hack the code to try to get the connection a couple of times but I was hoping someone was familiar with this problem or perhaps it is bug. Also, I am not clear as to whether I should use the TorqueDataSourceFactory or Jdbc2PoolDataSourceFactory. I've tried both and experience the same problem with both. Here are my current pooling properties: torque.database.tonys_raleigh.adapter=mysql torque.dsfactory.tonys_raleigh.factory=org.apache.torque.dsfactory.TorqueDat aSourceFactory torque.dsfactory.tonys_raleigh.pool.defaultMaxConnections=10 torque.dsfactory.tonys_raleigh.pool.maxExpiryTime=3600 torque.dsfactory.tonys_raleigh.pool.connectionWaitTimeout=10 torque.dsfactory.tonys_raleigh.connection.driver = org.gjt.mm.mysql.Driver torque.dsfactory.tonys_raleigh.connection.url = jdbc:mysql://localhost/tonys_raleigh torque.dsfactory.tonys_raleigh.connection.user = tonys_tspencer torque.dsfactory.tonys_raleigh.connection.password = mypass And here is what I'm using: Torque 3.0 rc1 Resin 2.1.1 MySql 3.23.53a JDBC: MySql Connector/J2 (2.0.14) Much thanks in advance, Tony -- To unsubscribe, e-mail: <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>
