Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLException: JZ0C0: Connection is already closed.

54 views
Skip to first unread message

eitanfux

unread,
Mar 4, 2002, 5:41:52 PM3/4/02
to
Hi,
I am working with Adaptive Server Anywhere 7, Jconnect 5.2 and with
Jonas aplication server.
in specific places on the aplication I got this JZ0C0: Connection is
already closed - error.
I understand that there is a connecion pooling problem, and my
application try to connect connection that already colse.
in my code all my sql excute done before I close the connections.
what can I do to solve this problem?
who can I trace the database connection pooling?
thanks
eitan
Cisco Systems

--------------------------------------------------------------------------------------------------------

java.sql.SQLException: JZ0C0: Connection is already closed.
at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
at
com.sybase.jdbc.SybConnection.checkConnection(SybConnection.java)
at
com.sybase.jdbc.SybConnection.prepareStatement(SybConnection.java)
at
com.sybase.jdbc.SybConnection.prepareStatement(SybConnection.java)
at
org.objectweb.jonas.jdbc_xa.ConnectionImpl.prepareStatement(ConnectionImpl.java:96)

at
com.cisco.nm.qpm.server.policy.ejb.PGEntityBean.doLoad(PGEntityBean.java:190)

at
com.cisco.nm.qpm.server.framework.BaseEntity.ejbLoad(BaseEntity.java:53)

at
org.objectweb.jonas_ejb.container.JContextEntity.activate(JContextEntity.java:372)

at
org.objectweb.jonas_ejb.container.ContextSwitch.getICtx(ContextSwitch.java:198)

at
org.objectweb.jonas_ejb.container.JBeanEntity.getEntityContext(JBeanEntity.java:175)

at
org.objectweb.jonas_ejb.container.JBeanEntity.preinvoke(JBeanEntity.java:307)

at
com.cisco.nm.qpm.server.policy.ejb.JOnASPGEntityRemote.getValueObject(classes\com\cisco\nm\qpm\server\policy\ejb\JOnASPGEntityRemote.java:40)

at
com.cisco.nm.qpm.server.policy.ejb.JOnASPGEntityRemote_Skel.dispatch(classes\com\cisco\nm\qpm\server\policy\ejb\JOnASPGEntityRemote_Skel.java:75)

at
sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:319)
at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:187)
at sun.rmi.transport.Transport$1.run(Transport.java:142)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)

at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643)

at java.lang.Thread.run(Thread.java:484)


J

unread,
Mar 5, 2002, 8:03:38 PM3/5/02
to
On Tue, 05 Mar 2002 00:41:52 +0200, eitanfux <eita...@yahoo.com>
wrote:

I would think some IO error is causing the connection to be closed.
Are you completely processing all resultsets.

You could attempt to do something like the following:

if ( conn instanceof PooledConnection) {
MyCel mcel = new MyCel((PooledConnection) conn);
} else {
System.out.println("Why isn't this a pooled
connection?");
}

public class MyCel implements ConnectionEventListener
{
private PooledConnection _pc;
public MyCel(PooledConnection pc) {
_pc = pc;
pc.addConnectionEventListener(this);
}

public void connectionClosed(ConnectionEvent ce)
{
System.out.println("connection closed: " + _pc);
}

public void connectionErrorOccurred(ConnectionEvent ce)
{
System.out.println("ConnectionError occurred : " +
_pc);
}
}

J

0 new messages