aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How to avoid dirty reads and incorrect commit in ejbs? 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 "How to avoid dirty reads and incorrect commit in ejbs?" Watch "How to avoid dirty reads and incorrect commit in ejbs?" New topic
Author

How to avoid dirty reads and incorrect commit in ejbs?

Siva Ram
Ranch Hand

Joined: Apr 04, 2002
Posts: 66
Hi,
In my Application , in a Stateless Session Bean, I am handling the data transaction via DataAccess Object Class. During this process , I have to update two transactions in two different tables. While doing so, it is commiting the transaction in the first table but the second one fails ? I set the transaction attribute for the SLB methods as required. And also before two transaction is not over , I am not commiting the transactions ? While the start of the program itself , I kept db commit to off. How to avoid this incorrect transaction without changing SLB to EntityBean. Is there any settings in WAS4.0 to avoid the above transaction ? Can any one help me to solve this ?
TAI,
N.Ravisankar


Thanks and Regards,<br />Siva Ram .NR
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Hi "NRavi",
We have a naming policy here at JavaRanch where all publicly displayed names take the form, "Firstname Surname". Could you please edit your profile to bring it into line?
Thanks in advance and we hope that you enjoy your stay at the ranch!
Cheers
Simon
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
As long as you�re using DAO�s you have the capacity to control the isolation level and the scope of the transaction, what gives you great flexibility, take a better look at the java.sql.Connection API(you can set the isolation level or demarcate the scope of the transaction with this one) and also at javax.transaction.UserTransaction(you can demarcate the scope of the transaction with this one) API, if you do a correct implementation and if you DB supports transactions you should be able to correct this problem.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi, you can have an introduction to the transaction concepts here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to avoid dirty reads and incorrect commit in ejbs?