-
1. Re: Last resource optimization
tnfink May 26, 2006 9:05 AM (in response to tnfink)Hi,
a partial answer to my own post:
I checked the sources from 4.0.4 and could see that this last resource optimization is implemented in:
org.jboss.tm.TransactionImpl
The 1st resource which is tagged with the LastResource interface is remembered in the field lastResource. Because LocalXAResource implements LastResource I guess that all local non-XA datasources are automatically last resources.
In prepareResources() lastResource is ignored regarding the prepare() itself but at the end it is committed. In commitResources() it is just ignored.
This is exactly the behavior I was told in that JBoss training.
But I am still wondering if this is an official feature?
-- Torsten
PS: I am somehow surprised that there is no warning if a resource is added with the tag LastInterface and there is already a lastResource set (addResource(), Line 1446). This looks a little bit dangerous.