jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Pfister <dominique.pfis...@day.com>
Subject Re: Re: JTA support
Date Tue, 26 Oct 2004 12:12:05 GMT
Hi David,

> i found that i had to make sure that i had to acquire 
> and also release nodes inside the transaction for 
> it to work properly, which means that i cannot
> use references to nodes that span into or out 
> of a transaction. is my observation correct?

Yes, this is correct.

> so, ...
> getRootNode()
> start()
> save()
> end()
> prepare()
> commit()
> doesn't work, but ...

Your sample invocation doesn't work because the items obtained still 
hold references to session-owned components to lookup other items. As 
the session's state has changed in the meantime, item state managers 
have been replaced with transactional ones.

However, an XASession is not meant to be used that way: it should simply 
supply methods to an application server for associating/disassociating 
its global transactions with a transactional resource. The application 
server will (invisibly to the user) invoke the methods exposed by the 
XAResource before allowing the user to make its standard calls to the 
Session object. There may be concurrent calls to the XAResource for 
different Xids as described in the JTA Specification (Chapter 3.4.6 
Resource Sharing), but an XASession will never be used as a 
non-transactional and transactional resource at the same time.


View raw message