[Mulgara-dev] ConnectionFactory updates

Life is hard, and then you die ronald at innovation.ch
Wed May 21 19:53:14 UTC 2008


On Tue, May 20, 2008 at 08:56:33PM -0400, Alex Hall wrote:
> 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.

Great! We've been having problems with stale RMI Session's, so the
ping will be useful.


  Cheers,

  Ronald




More information about the Mulgara-dev mailing list