You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Hamilton Verissimo de Oliveira (Engenharia - SPO)" <ha...@agenciaclick.com.br> on 2004/04/07 18:31:56 UTC

ManagedConnection.addConnectionEventListener

No ConnectionEventListener are being set up in ManagedConnection instances.
I putted a temporary 


		managedConnection.addConnectionEventListener(listener);


in the setConnectionEventListener of ManagedConnectionInfo class.
Neverthless the actual behavior of this implementation has a flaw (I think).
When a ManagedConnection raises ConnectionClosed - catched by
GeronimoConnectionEventListener - then ManagedConnectionInfo instance is not
pop'ed, and this code:


    public void returnConnection(ConnectionInfo connectionInfo,
ConnectionReturnAction connectionReturnAction) {

        if (connectionReturnAction == ConnectionReturnAction.DESTROY) {
            next.returnConnection(connectionInfo, connectionReturnAction);
        }

        TransactionContext transactionContext =
TransactionContext.getContext();
        if (transactionContext.isActive()) {
            return;
        }
        if
(connectionInfo.getManagedConnectionInfo().hasConnectionHandles()) {
            return; // Here, it still have connections handlers, of course
                    // they haven't been removed.
        }
        //No transaction, no handles, we return it.
        next.returnConnection(connectionInfo, connectionReturnAction);
    }


always returns without invoking the other interceptor (precisely the
MultiPoolConnectionInterceptor is never reached)


Thoughts?