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.

Reply via email to