jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihai Anescu" <mane...@totalsoft.ro>
Subject RE: session management with ejb 3.0
Date Thu, 06 Sep 2007 14:29:20 GMT
There was a bug in JR 1.3.0 about this. I have the same problem. The
thing is that the JR session attaches to the JTA transaction, so when
that transaction is committed the JR session becomes inactive. And you
can't even test that the session is inactive, every method throws that
damn exception (I tried to test if the session is no longer active get a
new session - some sort of session caching if you want). You can't use
even session.close().

What I have done: put the login/session creation inside the class
constructor, on each transaction you have to instantiate the object.

If you're using also Seam that complicates the things a little bit :D.

-----Original Message-----
From: Norbert Dreisiebner [mailto:norbert.dreisiebner@hms.org] 
Sent: Thursday, September 06, 2007 5:16 PM
To: users@jackrabbit.apache.org
Subject: session management with ejb 3.0

Dear guys,

I've got the following problem with Apache Jackrabbit JCA (1.3.1) and
container managed transactions (on EJB3.0/JBoss AS 4.2.1):
When using a single JCR session across multiple transactions, I get the
following exception:

2007-09-06 16:02:31,218 FATAL
javax.ejb.EJBTransactionRolledbackException: Inactive logical session
handle called
javax.ejb.EJBTransactionRolledbackException: Inactive logical session
handle called

When creating the session for every transaction, everything works fine.
Because this solution would require frequent re-logins, I would prefer
the first approach.

So is it possible to use a single session across multiple transactions,
or do I have to create a session within every transaction?

Best regards,
Norbert Dreisiebner

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.6/991 - Release Date:
05.09.2007 14:55

View raw message