You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Boris Kobilkovsky (JIRA)" <ji...@apache.org> on 2009/10/06 20:19:35 UTC
[jira] Created: (TRANSACTION-34) Connection handle is not set in
MapManagedConnection.close()
Connection handle is not set in MapManagedConnection.close()
------------------------------------------------------------
Key: TRANSACTION-34
URL: https://issues.apache.org/jira/browse/TRANSACTION-34
Project: Commons Transaction
Issue Type: Bug
Affects Versions: 1.2
Environment: all
Reporter: Boris Kobilkovsky
Priority: Minor
Setting a connection handle on close is an explicit requirement of JTA spec. Not setting the handle leads to memory leaks and incorrect connection state in transaction managers.
The fix is trivial. Below is the fixed correct implementation of org.apache.commons.transaction.memory.jca.MapManagedConnection.close()
public void close() {
ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
//the fix start
event.setConnectionHandle(connection);
///the fix end
for (Iterator it = listeners.iterator(); it.hasNext();) {
((ConnectionEventListener) it.next()).connectionClosed(event);
}
connection.invalidate();
connection = null;
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.