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 Re: ManagedConnection.addConnectionEventListener
Date Wed, 07 Apr 2004 23:00:43 GMT
-----Mensagem original-----
De: David Jencks [mailto:david@coredevelopers.net]

> 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.

Since you asked :-)

SinglePoolConnectionInterceptor.java:

In the returnConnection method:

Change 

            synchronized (pool) {
                mci.setLastUsed(System.currentTimeMillis());
				pool.addFirst(mci);
            }

to 

            synchronized (pool) {
                mci.setLastUsed(System.currentTimeMillis());
                if (pool.isEmpty())
                {
                	pool.addLast(mci);
                }
                else
                {
				pool.addFirst(mci);
                }
            }


When the pool is empty and you try to add the first connection it fails.
Strage that is not being catched in the test case.





Mime
View raw message