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/[email protected]/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: [EMAIL PROTECTED]
internet: http://www.aura.cz
http://www.j2ee.cz
---------------------------------