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: JTA support
Date Tue, 26 Oct 2004 22:47:48 GMT
David Nuescheler wrote:
>>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.
> to be a bit more precise i did the following:
> getRootNode()
> start()
> <-- all node modifications go here -->
> save()
> end()
> prepare()
> commit()
> [and somehow i did not expect this to throw]
> as mentioned before, i have no problems doing this any different
> way it is just an observation ;)

This is what I was trying to explain: before a transactional resource is 
handed out to a client, an application server will associate its global 
transaction with the resource (i.e. invoke XAResource.start). The client 
will invoke methods on the non-XA part of the resource and at the end of 
the request, the application server will disassociate the resource (i.e. 
invoke XAResource.end) before eventually committing or rolling back 
changes on all resources involved in the global transaction. Since your 
sample scenario is not described as part of the JTA specification, I 
wouldn't count on it not to throw...


View raw message