On Thu, May 03, 2001 at 05:46:47PM -0400, Anatoly Akkerman wrote:
>
> Hello, gurus
>
> I am still in the process of integrating Tyrex DTM with JBoss and here is
> my current challenge:
>
> I am trying to run Petstore in JBoss+Tyrex and running into problems, so I
> trace the same execution of Petstore in pristine JBoss with its native TM.
>
> Here is what I found.
>
> Petstore uses BMP Entity Beans and JBoss uses transaction synchronization
> objects to manage committing the changes to the database. What I found
> out, is that Tyrex commits transactions in a slightly different order than
> JBoss does.
>
> JBossTM order:
>
> 1) doBeforeCompletion() -- this invokes the sync objects and commits into
> the database
>
> 2) endResource()
>
> 3) change transaction status to COMMITTED when necessary
>
> Tyrex order:
>
> 1) set transaction status to COMMITTING
>
> 2) call beforeCompletion() -- this invokes the sync objects and causes an
> exception when EntitySynchronizationInterceptor tries to store the Entity
> bean and Minerva XAResource tries to enlist itself with the transaction
> which is now COMMITTING -- and IllegalStateException
>
> 3) the rest is irrelevant
>
> So, what are we to do here?
> It seems that Tyrex is not making any mistakes. Perhaps, we need to enlist
> the resource in advance with this transaction?
According to my reading of the JTA spec, this is a Tyrex bug. AFAICT,
enlisting a resource in beforeCompletion() should be fine. The relevent
text from the documentation for the Synchronization interface is:
The beforeCompletion method is called by the transaction manager prior
to the start of the transaction completion process. This call is
executed with the transaction context of the transaction that is being
committed.
The enlistResource method of Transaction says that it throws an
IllegalStateException if:
... the transaction in the target object is in prepared state or the
transaction is inactive.
Toby.
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development