File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: CMT EJB 2.1 Transaction Problems
 
Similar Threads
long post IBM.158
Transaction Management when stored procedure calls Java
tough questions on beans and others
Repeated calls of EJB method reaches maximum number of concurrent connections to database
SessionBean calling multiple stored procedures