commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Kobilkovsky (JIRA)" <j...@apache.org>
Subject [jira] Created: (TRANSACTION-36) NullPointerException when JCA connector is used under load
Date Tue, 20 Oct 2009 20:36:59 GMT
NullPointerException when JCA connector is used under load
----------------------------------------------------------

                 Key: TRANSACTION-36
                 URL: https://issues.apache.org/jira/browse/TRANSACTION-36
             Project: Commons Transaction
          Issue Type: Bug
            Reporter: Boris Kobilkovsky


 MapManagedConnection.close() is invalidated after all the listeners are notified. However,
the connection maybe resused before the methods ends. The solution is simple:

    public void close() {
        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
        // move invalidation before calling the listeners
        event.setConnectionHandle(connection);
        connection.invalidate();

        connection = null;
        for (Iterator it = listeners.iterator(); it.hasNext();) {
            ((ConnectionEventListener) it.next()).connectionClosed(event);
        }
    }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message