This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes ACID  properties in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ACID  properties in Java" Watch "ACID  properties in Java" New topic
Author

ACID properties in Java

Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
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


Man Suraj
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

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.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ACID properties in Java
 
Similar Threads
Creating file on a server through a jsp which is running on another server
Creating file on a server through a jsp which is running on another server
Creating file on a server through a jsp which is running on another server
another "Exception" problem?I dont' know ?
Creating file on a server through a jsp which is running on another server