jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Method to check healthy session?
Date Wed, 11 Apr 2012 20:54:26 GMT
Hi,

On Wed, Apr 11, 2012 at 10:19 PM, Francisco Carriedo Scher
<fcarriedos@gmail.com> wrote:
> i was talking about the Webdav one. The scenario is the following:
>
> 1) The repository is deployed and running within a JBoss 7 AS
> 2) There are client sessions operating it through Webdav
> 3) Suddenly the repository is undeployed (or the server shutdown)
> 4) The session.isLive() and session.refresh(true) methods return true (and
> no exception arises) despite the repository being not accessible anymore
>
> Anyway, session.save()  method does effectively throw an exception and then
> re-obtaining the repository object and the session can be performed, but
> under heavy load that leads to lots of TCP connections in TIME_WAIT state...

OK, I see.

I think ideally we should have Session.isLive() or Session.refresh()
ping the server for status, but I guess the current implementation
doesn't do that to avoid extra network roundtrips. Doing something
like a dummy query should force a network roundtrip regardless of the
caching layers without having to use a potentially unsafe operation
like save().

> Is there a better way to check the repository to be up and getting a new
> session if needed?

Do you really need long-living sessions? If you rather organize your
client so that each separate operation (think of individual HTTP
requests to a web application) uses a new, separate JCR session, then
you don't need to worry about sessions becoming stale.

BR,

Jukka Zitting

Mime
View raw message