aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes CMT EJB 2.1 Transaction Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "CMT EJB 2.1 Transaction Problems" Watch "CMT EJB 2.1 Transaction Problems" New topic
Author

CMT EJB 2.1 Transaction Problems

Przemek Sempre
Greenhorn

Joined: Feb 17, 2009
Posts: 1
Not long ago I bumped into a nice riddle. Let's have scenario:

1. call method A of Session Bean placed in EAR_1 - begin of transaction X
2 call method B of Session Bean placed in EAR_2 - change of datarow in database by stored procedure (setting that row to value "1" earlier it was "0")
3. recalculation of data in method A
4. call the same method B of Session Bean placed in EAR_2 - change of datarow in database by stored procedure (setting that row to value "0" now)
5 end of method A of Session Bean placed in EAR_1 - end of transaction X = commit

The question is: why, after commiting the transaction X, the datarow has value "1", not "0", as setting to "0" was the last operation on that row.

Tech specs:
Websphere 6.1, EJB 2.1, Database: Oracle 10, non-XA Oracle drivers, connection pool, all methods have TX_REQUIRED attributes, all transactions are container-managed.
When I set TX_NOTSUPPORTED transaction attribute of method A, the datarow has value "0" at the end - the right value.

Can anybody explain this strange behaviour ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: CMT EJB 2.1 Transaction Problems