Solved

J2EE ACID Transaction Sample

Posted on 2014-03-10
1
370 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 21

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

809 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