I've modified your equals method but kept hashcode. This uncovered several other problems in the tests which I have fixed.

Please let me know if you find more problems.

thanks
david jencks


On Wednesday, April 7, 2004, at 10:06 AM, Hamilton Verissimo de Oliveira (Engenharia - SPO) wrote:


Ok, this is solved with a patch to OpenEJB (JdbcConnectionManager.java)
already submited and a a simple equals/hashcode implementation in
org.apache.geronimo.connector.outbound.ConnectionInfo:

    public boolean equals(Object obj)
    {
        if (obj instanceof ConnectionInfo == false)
        {
                return false;
        }
                ConnectionInfo other = (ConnectionInfo) obj;
                if (other.connection != null && connection != null &&
other.connection.equals(connection))
                {
                        if (other.mci != null && mci != null &&
other.mci.equals(mci))
                        {
                                return true;
                        }
                }
                return false;
    }

Why's that?

Simple. When GeronimoConnectionEventListener.connectionClosed in invoked
from the ManagedConnection. It then recreates an ConnectionInfo instance
with the event arguments. One of interceptors steps is to remove it from
GeronimoConnectionEventListener.connectionInfos array list. If the item is
not removed, no pooling will occur.


PS: I implemented hashcode just as a good practice. Its not being used.

    public int hashCode()
    {
        return
                ((connection != null) ? connection.hashCode() : 7) ^
                ((mci != null) ? mci.hashCode() : 7);
    }


-----Mensagem original----- De: Hamilton Verissimo de Oliveira (Engenharia - SPO) [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 7 de abril de 2004 13:32 Para: [EMAIL PROTECTED] Apache. Org (E-mail) Assunto: ManagedConnection.addConnectionEventListener

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)




Reply via email to