You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Paco Avila <pa...@git.es> on 2007/10/07 19:50:23 UTC

Transactions with Jackrabbit?

Where can I find some info (and sample code, if any) about using
transactions with Jackrabbit?

Thanks!

-- 
GIT CONSULTORS 

www.git.es

Tel: +34 971 498 310
Fax: +34 971 496 189

C/ Francesc Rover, 2B. 
07003 Palma de Mallorca – Illes Balears (España)



Re: Transactions with Jackrabbit?

Posted by Paco Avila <pa...@git.es>.
El mié, 10-10-2007 a las 18:44 +0200, Paco Avila escribió:
> El lun, 08-10-2007 a las 11:26 +0200, Stefan Ivanov escribió:
> > You can see here:
> > http://jackrabbit.apache.org/faq.html#using-jta
> > 
> > I use the spring-modules-0.8 with the jackrabbit 1.3.1 and I have bad
> > expirience with it. Especially concurent acces to the same node and node
> > versioning are not thread save. Thas's why i couldn't use versioning in my
> > prototype system and have my own implementation.
> 
> I have some troubles with JTA. In my code I perform a node lock and a
> checkout. If the checkout fails the lock should be rolledback, but... it
> is not working :( 
> 
> try {
>   xares.start(xid, XAResource.TMNOFLAGS);
>   node.lock(true, false);
> 
>   ---> SOME EXCEPTION IS THROWN <---
> 
>   node.checkout();
>   xares.end(xid, XAResource.TMSUCCESS);
>   xares.prepare(xid);
>   xares.commit(xid, false);
> } catch (Exception e) {
>   xares.prepare(xid);
>   xares.rollback(xid);
> }
> 

Answering to myselft: works ok, there was a bug in my code. Sorry!
-- 
GIT CONSULTORS 

www.git.es

Tel: +34 971 498 310
Fax: +34 971 496 189

C/ Francesc Rover, 2B. 
07003 Palma de Mallorca – Illes Balears (España)



Re: Transactions with Jackrabbit?

Posted by Paco Avila <pa...@git.es>.
El lun, 08-10-2007 a las 11:26 +0200, Stefan Ivanov escribió:
> You can see here:
> http://jackrabbit.apache.org/faq.html#using-jta
> 
> I use the spring-modules-0.8 with the jackrabbit 1.3.1 and I have bad
> expirience with it. Especially concurent acces to the same node and node
> versioning are not thread save. Thas's why i couldn't use versioning in my
> prototype system and have my own implementation.

I have some troubles with JTA. In my code I perform a node lock and a
checkout. If the checkout fails the lock should be rolledback, but... it
is not working :( 

try {
  xares.start(xid, XAResource.TMNOFLAGS);
  node.lock(true, false);

  ---> SOME EXCEPTION IS THROWN <---

  node.checkout();
  xares.end(xid, XAResource.TMSUCCESS);
  xares.prepare(xid);
  xares.commit(xid, false);
} catch (Exception e) {
  xares.prepare(xid);
  xares.rollback(xid);
}

-- 
GIT CONSULTORS 

www.git.es

Tel: +34 971 498 310
Fax: +34 971 496 189

C/ Francesc Rover, 2B. 
07003 Palma de Mallorca – Illes Balears (España)



Re: Transactions with Jackrabbit?

Posted by Stefan Ivanov <st...@gmail.com>.
Thanks for your hint. I'll try the new release.

2007/10/8, Jukka Zitting <ju...@gmail.com>:
>
> Hi,
>
> On 10/8/07, Stefan Ivanov <st...@gmail.com> wrote:
> > I use the spring-modules-0.8 with the jackrabbit 1.3.1 and I have bad
> > expirience with it. Especially concurent acces to the same node and node
> > versioning are not thread save.
>
> You may want to check out the Jackrabbit 1.3.3 release that'll be
> announced today as soon as the Jackrabbit web site gets updated. This
> release fixes a number of concurrency issues related to versioning,
> most notably JCR-18 and JCR-692.
>
> BR,
>
> Jukka Zitting
>

Re: Transactions with Jackrabbit?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 10/8/07, Stefan Ivanov <st...@gmail.com> wrote:
> I use the spring-modules-0.8 with the jackrabbit 1.3.1 and I have bad
> expirience with it. Especially concurent acces to the same node and node
> versioning are not thread save.

You may want to check out the Jackrabbit 1.3.3 release that'll be
announced today as soon as the Jackrabbit web site gets updated. This
release fixes a number of concurrency issues related to versioning,
most notably JCR-18 and JCR-692.

BR,

Jukka Zitting

Re: Transactions with Jackrabbit?

Posted by Paco Avila <pa...@git.es>.
El lun, 08-10-2007 a las 11:26 +0200, Stefan Ivanov escribió:
> You can see here:
> http://jackrabbit.apache.org/faq.html#using-jta
> 
> I use the spring-modules-0.8 with the jackrabbit 1.3.1 and I have bad
> expirience with it. Especially concurent acces to the same node and node
> versioning are not thread save. Thas's why i couldn't use versioning in my
> prototype system and have my own implementation.

You can make the method synchronized anyway. Have you try this?

-- 
GIT CONSULTORS 

www.git.es

Tel: +34 971 498 310
Fax: +34 971 496 189

C/ Francesc Rover, 2B. 
07003 Palma de Mallorca – Illes Balears (España)



Re: Transactions with Jackrabbit?

Posted by Stefan Ivanov <st...@gmail.com>.
You can see here:
http://jackrabbit.apache.org/faq.html#using-jta

I use the spring-modules-0.8 with the jackrabbit 1.3.1 and I have bad
expirience with it. Especially concurent acces to the same node and node
versioning are not thread save. Thas's why i couldn't use versioning in my
prototype system and have my own implementation.



2007/10/7, Paco Avila <pa...@git.es>:
>
> Where can I find some info (and sample code, if any) about using
> transactions with Jackrabbit?
>
> Thanks!
>
> --
> GIT CONSULTORS
>
> www.git.es
>
> Tel: +34 971 498 310
> Fax: +34 971 496 189
>
> C/ Francesc Rover, 2B.
> 07003 Palma de Mallorca – Illes Balears (España)
>
>
>