incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <martin.k...@aura.cz>
Subject [jcr-mapping] Session lifecycle
Date Mon, 31 Oct 2005 14:58:31 GMT
Hi,
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(SessionImpl.java:329)
at org.apache.jackrabbit.core.SessionImpl.itemExists(SessionImpl.java:743)
at 
org.apache.portals.graffito.jcr.persistence.impl.PersistenceManagerImpl.objectExists(PersistenceManagerImpl.java:242)

David Nuescheler recommends create new session on every request! See 
http://www.mail-archive.com/jackrabbit-dev@incubator.apache.org/msg02273.html

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
e-mail:  martin.koci@aura.cz
internet: http://www.aura.cz
         http://www.j2ee.cz
--------------------------------- 


Mime
View raw message