Solved

J2EE ACID Transaction Sample

Posted on 2014-03-10
1
351 Views
Last Modified: 2014-05-14
Hi,
I had a query "How J2EE manage transaction?" same as RDBMS ACID (Atomicity, Consistency, Isolation, Durability) engine.

Someone replied on how J2ee transactions are managed to make sure they are successful or failed by giving following example.

Example :
Money taken out of account A (Debit) and added to account B (credit). This process should either complete else fail.

Solution is implemented in 2 stages-
      1. Record move money going out from account of A
      2. Record money moving into account of B
      3. When transaction is complete , both accounts (A,B) are  notified that operation is   complete.
      4. If any issues observed both accounts are rolled back

Is this right and can someone share a J2EE code samples to integrate it for my app?

Thanks
0
Comment
Question by:crazywolf2010
1 Comment
 
LVL 20

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 40057497
Dont know about your application for that you are looking a sample code. But you can refer http://www.java-tips.org/java-ee-tips/enterprise-java-beans/introduction-to-the-java-transactio.html and understand the J2EE transaction API.

Once you understand the J2EE TXN api and how to use it, you will be able to write a code for your application. Its not too difficult.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 71
count8 challlenge 13 85
HashMap Vs TreeMap 12 48
Cipher Configuration on Apache HTTPD 4 19
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now