geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hamilton Verissimo de Oliveira (Engenharia - SPO)" <hamilton.olive...@agenciaclick.com.br>
Subject ManagedConnection.addConnectionEventListener
Date Wed, 07 Apr 2004 16:31:56 GMT

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?


Mime
View raw message