incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <>
Subject [jcr-mapping] Session lifecycle
Date Mon, 31 Oct 2005 14:58:31 GMT
I have question about javax.jcr.Session management with jcr-mapping.
Instance of PM encapsulates a session. But this session can be 
invalidated with session.logout(). Than session.isLive() returns false - 
also returns false if session times-out or is disconnected from 
repository for some reason.

So such behavior may lead to :
Caused by: javax.jcr.RepositoryException: this session has been closed
at org.apache.jackrabbit.core.SessionImpl.sanityCheck(
at org.apache.jackrabbit.core.SessionImpl.itemExists(

David Nuescheler recommends create new session on every request! See

Because repository can disconnect session we cannot rely on instance in 
PM. There can be some re-new or re-connect logic.

Mgr. Martin Kočí
AURA, s.r.o.
Úvoz 499/56; 602 00 Brno
ISO 9001 certifikovaná společnost
tel./fax: +420 5 43 24 51 11

View raw message