[Mulgara-dev] ConnectionFactory updates

Alex Hall alexhall at revelytix.com
Wed May 21 00:56:33 UTC 2008


Paul Gearon wrote:
> On Tue, May 20, 2008 at 4:56 PM, Alex Hall <alexhall at revelytix.com> wrote:
> <snip/>
>> I have also overridden the finalize method on the Connection in order to
>> try and reclaim Sessions from Connections that have been abandoned but
>> not closed by the client.  Also, there is a new Connection.dispose()
>> method which will allow the client to explicitly close the underlying
>> Session, in which case it will not be re-used by the factory.
> 
> Seems reasonable. It makes me wonder if we want to somehow tell if
> Sessions are closed, and not let the Factory reclaim them in that
> event. e.g. When the factory goes to insert it in the cache is does a
> Session.isClosed() on it first. Maybe that's overkill though.

I forgot to mention in the initial email, when a Session is retrieved 
from the cache its connectivity is verified using a new Session.ping() 
method.  This was meant to handle the case of a timed-out RMI session or 
of a change in the local IP address, but if the Session was closed then 
it would also fail this test and be discarded anyways.  Since the 
Session is already checked when it's retrieved from the cache, I don't 
think it's necessary to check it on insertion as well.

Alex



More information about the Mulgara-dev mailing list