users@glassfish.java.net

Re: getNonTxConnection

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 Aug 2009 12:48:47 PDT

Hey culli,

I'm not so experienced, but I hope that I can help you (-:

Well, about the transaction issue. If your code is inside a global transaction, then the developer whose implemented this code probably called the getNonTxConnection or because he wanted to have control over the connection and do some kind of super-special-technique using setAutoCommit(false), commit() and rollback(), or by mistake. Probably the latter.

And about the connection leaking... You have to objects, con and drivercon. Are you getting a connection from con (another connection)? Is it a method in some version of the java.sql.Connection class?

Anyway, it would be safer to close both connections, no? The con and drivercon connections.

Tell me if it works, ok?

Regards,
Bruno
[Message sent by forum member 'kinow' (kinow)]

http://forums.java.net/jive/thread.jspa?messageID=359960