• 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

ACID properties in Java

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can i achieve ACID properties i.e related to a transaction in Java.

For eg

I wannt to transfer amt from A's Acct to B's acct. Now say, 100 bucks are debitted from A's Acct, but then some exception happens, and therefor B's acct is not credited with the same. Could anyone please tell me how can i handle this scenario in Java
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will need a transaction manager that will manage the two-phase commit between the two databases.

Java EE application servers have such transaction managers built it, so if you are doing this within a web application (or actually, within an EJB) you should be OK - but check the app server's documentation for transaction handling

If you are write a Java SE app, then I suggest you find a java transaction manager and use it within your app.
 
reply
    Bookmark Topic Watch Topic
  • New Topic