You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Tony Rozga <to...@neovalent.com> on 2008/12/08 19:03:31 UTC
Tomcat 6 + Jackrabbit + transactions
Hi, Jackrabbit newb here:
I've found plenty of examples/mail threads that talk about deploying
Jackrabbit as a JCA resource and how that means Jackrabbit is
automatically aware of the JCA transactional context. We need to
support Tomcat 6 though and that config still confuses me as Tomcat is
not a JCA container.
I've found several transaction manager implementations (Bitronix,
Atomikos) that can be used in Tomcat. If I setup on of these and start
a UserTransaction in my code and then do some Jackrabbit ops, will
Jackrabbit be aware of that transaction context? Given that a
Jackrabbit Session is the underlying XAResource, what about a single
transaction that spans multiple Sessions?
Thanks,
Tony Rozga
Re: Tomcat 6 + Jackrabbit + transactions
Posted by GuyPardon <gu...@atomikos.com>.
Hi,
slandelle wrote:
>
>> It is my understanding that something like Atomikos
>> is an implementation of the JTA and could be used as that manager but it
>> is unclear how to coordinate that piece and Jackrabbit
>
Just do the following:
-start a JTA transaction
-get the current transaction from the TransactionManager instance
-enlist the XAResource(s)
-do your transactional work
-commit the JTA transaction
The Atomikos JTA is Apache-licensed and can be used without any problems in
Jackrabbit. There is nothing to configure really, just about everything can
be based on defaults.
Best
Guy
http://www.atomikos.com
--
View this message in context: http://www.nabble.com/Tomcat-6-%2B-Jackrabbit-%2B-transactions-tp20900436p20919192.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Tomcat 6 + Jackrabbit + transactions
Posted by sl...@excilys.com.
> Our need for transactions is based on the fact that we are using
> multiple Jackrabbit workspaces and need transactional semantics for
changes that span multiple workspaces.
Just one question : what do you use several workspaces for? I ask this
question because people tend to have workspaces for seperating fonctionnal
perimeters. See http://wiki.apache.org/jackrabbit/DavidsModel Rule #3.
>
> I think I could code this project 5 times before I learned enough about
> Spring to use it :) I was hoping to find a lighter-weight transaction
> manager that could coordinate changes to multiple workspaces. All of my
> reading has given me the impression that there is some combination of
> things out there that can accomplish this in Tomcat6.
> org.apache.jackrabbit.core.XASessionImpl implements XAResource which can
> be manipulated individually (like
> org.apache.jackrabbit.core.UserTransactionImpl does) or in concert like a
> javax.transaction.Transaction does by enlisting multiple XAResources in a
> single transaction. It is my understanding that something like Atomikos
> is an implementation of the JTA and could be used as that manager but it
> is unclear how to coordinate that piece and Jackrabbit.
I really should give Spring a shot!
It provides you with a handly transaction support, can provide you with a
LocalTransactionManager (the one for Jackrabbit is not in Spring Core but
in SPring modules) and can provide a JTA support (in this case, you have
to feed your own TransactionManager).
If you want to work with several workspaces, you'll probably have to
customize some stuff because.
For application that don't run on a complete app-server, I use Jencks as a
JTA provider. I find it much cleaser and easier to configure that
Atomikos.
BR,
Stéphane Landelle
Re: Tomcat 6 + Jackrabbit + transactions
Posted by Tony Rozga <to...@neovalent.com>.
slandelle@excilys.com wrote:
> You're confusing JTA and JCA (even if these 2 are often linked I agree).
> Let's take the problem from start : you want transactions! :)
>
yes, transactions! :)
> Do you need 2PC? How do you intend to work with your transactions? Spring?
>
>
Our need for transactions is based on the fact that we are using
multiple Jackrabbit workspaces and need transactional semantics for
changes that span multiple workspaces.
I think I could code this project 5 times before I learned enough about
Spring to use it :) I was hoping to find a lighter-weight transaction
manager that could coordinate changes to multiple workspaces. All of my
reading has given me the impression that there is some combination of
things out there that can accomplish this in Tomcat6.
org.apache.jackrabbit.core.XASessionImpl implements XAResource which can
be manipulated individually (like
org.apache.jackrabbit.core.UserTransactionImpl does) or in concert like
a javax.transaction.Transaction does by enlisting multiple XAResources
in a single transaction. It is my understanding that something like
Atomikos is an implementation of the JTA and could be used as that
manager but it is unclear how to coordinate that piece and Jackrabbit.
Tony
> Stéphane Landelle
>
>
> Le Lun 8 décembre 2008 19:03, Tony Rozga a écrit :
>
>> Hi, Jackrabbit newb here:
>>
>>
>> I've found plenty of examples/mail threads that talk about deploying
>> Jackrabbit as a JCA resource and how that means Jackrabbit is
>> automatically aware of the JCA transactional context. We need to support
>> Tomcat 6 though and that config still confuses me as Tomcat is
>> not a JCA container.
>>
>> I've found several transaction manager implementations (Bitronix,
>> Atomikos) that can be used in Tomcat. If I setup on of these and start
>> a UserTransaction in my code and then do some Jackrabbit ops, will
>> Jackrabbit be aware of that transaction context? Given that a
>> Jackrabbit Session is the underlying XAResource, what about a single
>> transaction that spans multiple Sessions?
>>
>> Thanks,
>> Tony Rozga
>>
>>
>>
>>
>>
>
>
>
>
Re: Tomcat 6 + Jackrabbit + transactions
Posted by sl...@excilys.com.
You're confusing JTA and JCA (even if these 2 are often linked I agree).
Let's take the problem from start : you want transactions! :)
Do you need 2PC? How do you intend to work with your transactions? Spring?
Stéphane Landelle
Le Lun 8 décembre 2008 19:03, Tony Rozga a écrit :
> Hi, Jackrabbit newb here:
>
>
> I've found plenty of examples/mail threads that talk about deploying
> Jackrabbit as a JCA resource and how that means Jackrabbit is
> automatically aware of the JCA transactional context. We need to support
> Tomcat 6 though and that config still confuses me as Tomcat is
> not a JCA container.
>
> I've found several transaction manager implementations (Bitronix,
> Atomikos) that can be used in Tomcat. If I setup on of these and start
> a UserTransaction in my code and then do some Jackrabbit ops, will
> Jackrabbit be aware of that transaction context? Given that a
> Jackrabbit Session is the underlying XAResource, what about a single
> transaction that spans multiple Sessions?
>
> Thanks,
> Tony Rozga
>
>
>
>