• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to avoid dirty reads and incorrect commit in ejbs?

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, you can have an introduction to the transaction concepts here
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic