This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to avoid dirty reads and incorrect commit in ejbs?  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi, you can have an introduction to the transaction concepts here
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!