Phillipe Durieux wrote:
>No, it's a misunderstanding. It's true that in the client process, the
>Current
>class is local to the process. Only when the client will call a remote bean
>the transaction become a distributed transaction. The implicit propagation
>of the
>transaction context insure that the bean will be aware that a transaction has
>started, so the trace you see in the server then is normal.
I don't think I'm seeing the transaction propogation. Specifically, I'm
seeing a failure in the session bean client example. The relevant client
code is:
utx.begin();
t1.buy(50);
System.out.println("Rollback the transaction");
utx.rollback();
val = t1.read();
The call to t1.buy() appears to start and commit a new transaction rather
than using the transaction started by utx.begin(). Thus, when t1.read()
is called, the returned "val" is 50 more than expected. Following is the
trace with annotations from the corresponding source.
Thanks for your help.
- Mike Rubin
- Modulo Systems Corporation
==================================================
// utx.begin(); // No trace from this call
// t1.buy(50);
JOnASOpBeanOp.buy()
JBeanSession.preinvoke()
Transaction Attribute = TX_REQUIRED
Current.getTransaction()
Method called outside a transaction scope : begin a transaction
Current.begin()
XidImpl constructor
new Xid = 965481925808131
TransactionImpl.TransactionImpl(Xid xid, int timeout)
Attach Tx to Thread
Associate Tx to Xid:org.objectweb.jonas.jta.XidImpl@3
TransactionImpl.setTimer(TimerEvent timer)
is a SessionSynchronization!
SessionSynchroImpl.considerRequest()
Current.getTransaction()
TransactionImpl.registerSynchronization(Synchronization sync)
TransactionImpl.makeSubCoord()
SubCoordinator.SubCoordinator(TransactionImpl tx, Xid xid)
SubCoordinator.addSynchronization(Synchronization synchro)
JBeanSession.postinvoke()
Committing transaction
Current.commit()
Current.getTransaction()
Detach Thread from Tx
TransactionImpl.commit()
SubCoordinator.commit_one_phase()
SubCoordinator.doBeforeCompletion()
TransactionImpl.unsetTimer()
Current.getTransaction()
Current.resume()
Attach Tx to Thread
SessionSynchroImpl.beforeCompletion()
Current.suspend()
Detach Thread from Tx
SubCoordinator.doPrepare()
SubCoordinator.doAfterCompletion()
SessionSynchroImpl.afterCompletion(Status 3)
OpBean::aftercompletion: committed = true
SynchroImpl reset
Current.freeAllConnections(Transaction tx)
Remove Tx from Xid:org.objectweb.jonas.jta.XidImpl@3
// utx.rollback();
// val = t1.read(); // returns 80
JOnASOpBeanOp.read()
JBeanSession.preinvoke()
Transaction Attribute = TX_REQUIRED
Current.getTransaction()
Method called outside a transaction scope : begin a transaction
Current.begin()
XidImpl constructor
new Xid = 965481926025220
TransactionImpl.TransactionImpl(Xid xid, int timeout)
Attach Tx to Thread
Associate Tx to Xid:org.objectweb.jonas.jta.XidImpl@4
TransactionImpl.setTimer(TimerEvent timer)
is a SessionSynchronization!
SessionSynchroImpl.considerRequest()
Current.getTransaction()
TransactionImpl.registerSynchronization(Synchronization sync)
TransactionImpl.makeSubCoord()
SubCoordinator.SubCoordinator(TransactionImpl tx, Xid xid)
SubCoordinator.addSynchronization(Synchronization synchro)
JBeanSession.postinvoke()
Committing transaction
Current.commit()
Current.getTransaction()
Detach Thread from Tx
TransactionImpl.commit()
SubCoordinator.commit_one_phase()
SubCoordinator.doBeforeCompletion()
TransactionImpl.unsetTimer()
Current.getTransaction()
Current.resume()
Attach Tx to Thread
SessionSynchroImpl.beforeCompletion()
Current.suspend()
Detach Thread from Tx
SubCoordinator.doPrepare()
SubCoordinator.doAfterCompletion()
SessionSynchroImpl.afterCompletion(Status 3)
OpBean::aftercompletion: committed = true
SynchroImpl reset
Current.freeAllConnections(Transaction tx)
Remove Tx from Xid:org.objectweb.jonas.jta.XidImpl@4