From scarney@telusplanet.net Sat Apr 5 04:25:33 2003
Return-Path:
Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm
Delivered-To: mailing list torque-user@db.apache.org
Received: (qmail 63108 invoked from network); 5 Apr 2003 04:25:33 -0000
Received: from outbound04.telus.net (HELO priv-edtnes15-hme0.telusplanet.net) (199.185.220.223)
by daedalus.apache.org with SMTP; 5 Apr 2003 04:25:33 -0000
Received: from telusplanet.net ([161.184.96.12])
by priv-edtnes15-hme0.telusplanet.net
(InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with ESMTP
id <20030405042542.EVNT19213.priv-edtnes15-hme0.telusplanet.net@telusplanet.net>
for ; Fri, 4 Apr 2003 21:25:42 -0700
Message-ID: <3E8E5AC6.50207@telusplanet.net>
Date: Fri, 04 Apr 2003 21:25:42 -0700
From: Stan Carney
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: torque-user@db.apache.org
Subject: Hard to track down PooledConnection problem
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
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.(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.(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.(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.(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)