db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stan Carney <scar...@telusplanet.net>
Subject Hard to track down PooledConnection problem
Date Sat, 05 Apr 2003 04:25:42 GMT
I'm having a hard time trying to solve this exception. It is only thrown 
in 4 places all of which are in JMS MessageListeners. We had trouble 
with this exception before but it was related to they way we were doing 
transactions. They are not thrown everytime or in any order. The only 
thing not random about these exceptions is the JMS MessageListener thing.

Attached you will find 2 exceptions and associated code.

public class ReportSchedulePeer
     extends com.ams.uptime.domain.BaseReportSchedulePeer
{
     /**
      * Finds a report schedule given a reportScheduleId.
      */
     public static ReportSchedule findReportScheduleById(int 
reportScheduleId)  throws TorqueException {

         // Build criteria.
         Criteria criteria = new Criteria();
         criteria.add(ReportSchedulePeer.SCHEDULE_ID, reportScheduleId);

         // Execute query.
         List results = new ArrayList();
         results = doSelect(criteria);

         // Returns the result.
         if (results.isEmpty()) {
             return null;
         } else {
             return (ReportSchedule) results.get(0);
         }
     }
}


Exception one:
java.sql.SQLException: PooledConnection was reused, withoutits previous 
Connection being closed.
	at 
org.apache.commons.jdbc2pool.adapter.PooledConnectionImpl.getConnection(PooledConnectionImpl.java:195)
	at 
org.apache.commons.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:918)
	at 
org.apache.commons.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:821)
	at org.apache.torque.Torque.getConnection(Torque.java:894)
	at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1490)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1375)
	at 
com.ams.uptime.domain.BaseSummConfigHdrPeer.doSelectVillageRecords(BaseSummConfigHdrPeer.java:322)
	at 
com.ams.uptime.domain.BaseSummConfigHdrPeer.doSelectVillageRecords(BaseSummConfigHdrPeer.java:293)
	at 
com.ams.uptime.domain.BaseSummConfigHdrPeer.doSelect(BaseSummConfigHdrPeer.java:272)
	at 
com.ams.uptime.loader.LoadSummaryFileListener$MessageHandler.loadFileConfiguration(LoadSummaryFileListener.java:237)
	at 
com.ams.uptime.loader.LoadSummaryFileListener$MessageHandler.loadFile(LoadSummaryFileListener.java:194)
	at 
com.ams.uptime.loader.LoadSummaryFileListener$MessageHandler.<init>(LoadSummaryFileListener.java:107)
	at 
com.ams.uptime.loader.LoadSummaryFileListener.onMessage(LoadSummaryFileListener.java:63)
	at org.exolab.jms.client.JmsMessageConsumer.onMessage(Unknown Source)
	at org.exolab.jms.client.JmsSession.execute(Unknown Source)
	at org.exolab.jms.client.JmsSession.onMessage(Unknown Source)
	at org.exolab.jms.client.rmi.RmiJmsSessionStub.onMessage(Unknown Source)
	at java.lang.reflect.Method.invoke(Native Method)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
	at sun.rmi.transport.Transport$1.run(Transport.java:147)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
	at java.lang.Thread.run(Thread.java:479)


rethrown as
org.apache.torque.TorqueException: PooledConnection was reused, 
withoutits previous Connection being closed.
	at org.apache.torque.Torque.getConnection(Torque.java:906)
	at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1490)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1375)
	at 
com.ams.uptime.domain.BaseSummConfigHdrPeer.doSelectVillageRecords(BaseSummConfigHdrPeer.java:322)
	at 
com.ams.uptime.domain.BaseSummConfigHdrPeer.doSelectVillageRecords(BaseSummConfigHdrPeer.java:293)
	at 
com.ams.uptime.domain.BaseSummConfigHdrPeer.doSelect(BaseSummConfigHdrPeer.java:272)
	at 
com.ams.uptime.loader.LoadSummaryFileListener$MessageHandler.loadFileConfiguration(LoadSummaryFileListener.java:237)
	at 
com.ams.uptime.loader.LoadSummaryFileListener$MessageHandler.loadFile(LoadSummaryFileListener.java:194)
	at 
com.ams.uptime.loader.LoadSummaryFileListener$MessageHandler.<init>(LoadSummaryFileListener.java:107)
	at 
com.ams.uptime.loader.LoadSummaryFileListener.onMessage(LoadSummaryFileListener.java:63)
	at org.exolab.jms.client.JmsMessageConsumer.onMessage(Unknown Source)
	at org.exolab.jms.client.JmsSession.execute(Unknown Source)
	at org.exolab.jms.client.JmsSession.onMessage(Unknown Source)
	at org.exolab.jms.client.rmi.RmiJmsSessionStub.onMessage(Unknown Source)
	at java.lang.reflect.Method.invoke(Native Method)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
	at sun.rmi.transport.Transport$1.run(Transport.java:147)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
	at java.lang.Thread.run(Thread.java:479)


Exception two:
java.sql.SQLException: PooledConnection was reused, withoutits previous 
Connection being closed.
	at 
org.apache.commons.jdbc2pool.adapter.PooledConnectionImpl.getConnection(PooledConnectionImpl.java:195)
	at 
org.apache.commons.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:918)
	at 
org.apache.commons.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:821)
	at org.apache.torque.Torque.getConnection(Torque.java:894)
	at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1490)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1375)
	at 
com.ams.uptime.domain.BaseReportSchedulePeer.doSelectVillageRecords(BaseReportSchedulePeer.java:348)
	at 
com.ams.uptime.domain.BaseReportSchedulePeer.doSelectVillageRecords(BaseReportSchedulePeer.java:319)
	at 
com.ams.uptime.domain.BaseReportSchedulePeer.doSelect(BaseReportSchedulePeer.java:298)
	at 
com.ams.uptime.domain.ReportSchedulePeer.findReportScheduleById(ReportSchedulePeer.java:35)
	at 
com.ams.uptime.messaging.ReportGenerationListener$MessageHandler.getReportSchedule(ReportGenerationListener.java:143)
	at 
com.ams.uptime.messaging.ReportGenerationListener$MessageHandler.<init>(ReportGenerationListener.java:60)
	at 
com.ams.uptime.messaging.ReportGenerationListener.onMessage(ReportGenerationListener.java:25)
	at org.exolab.jms.client.JmsMessageConsumer.onMessage(Unknown Source)
	at org.exolab.jms.client.JmsSession.execute(Unknown Source)
	at org.exolab.jms.client.JmsSession.onMessage(Unknown Source)
	at org.exolab.jms.client.rmi.RmiJmsSessionStub.onMessage(Unknown Source)
	at java.lang.reflect.Method.invoke(Native Method)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
	at sun.rmi.transport.Transport$1.run(Transport.java:147)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
	at java.lang.Thread.run(Thread.java:479)

rethrown as
org.apache.torque.TorqueException: PooledConnection was reused, 
withoutits previous Connection being closed.
	at org.apache.torque.Torque.getConnection(Torque.java:906)
	at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1490)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1375)
	at 
com.ams.uptime.domain.BaseReportSchedulePeer.doSelectVillageRecords(BaseReportSchedulePeer.java:348)
	at 
com.ams.uptime.domain.BaseReportSchedulePeer.doSelectVillageRecords(BaseReportSchedulePeer.java:319)
	at 
com.ams.uptime.domain.BaseReportSchedulePeer.doSelect(BaseReportSchedulePeer.java:298)
	at 
com.ams.uptime.domain.ReportSchedulePeer.findReportScheduleById(ReportSchedulePeer.java:35)
	at 
com.ams.uptime.messaging.ReportGenerationListener$MessageHandler.getReportSchedule(ReportGenerationListener.java:143)
	at 
com.ams.uptime.messaging.ReportGenerationListener$MessageHandler.<init>(ReportGenerationListener.java:60)
	at 
com.ams.uptime.messaging.ReportGenerationListener.onMessage(ReportGenerationListener.java:25)
	at org.exolab.jms.client.JmsMessageConsumer.onMessage(Unknown Source)
	at org.exolab.jms.client.JmsSession.execute(Unknown Source)
	at org.exolab.jms.client.JmsSession.onMessage(Unknown Source)
	at org.exolab.jms.client.rmi.RmiJmsSessionStub.onMessage(Unknown Source)
	at java.lang.reflect.Method.invoke(Native Method)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
	at sun.rmi.transport.Transport$1.run(Transport.java:147)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
	at java.lang.Thread.run(Thread.java:479)


Mime
View raw message