This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes A Query when using EJB Container Manestaged Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "A Query when using EJB Container Manestaged Transaction" Watch "A Query when using EJB Container Manestaged Transaction" New topic
Author

A Query when using EJB Container Manestaged Transaction

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi
I am sorry for the haeding of the question ( I could not think better).

I am using EJB ContainerManaged Transaction suppourt on to my Application .
Hi i am doing a insert operation.This insert operation involves inserting into two tables .

For example :


The requirement is
Insertion for the buses table should be done first and then insertion into DTR table should happen.(Both of these statemets are in the same method.)

The scenario is that , if the insert for the DTR table fails due to Runtime data passed , i want to rollback the insertion that happened on to the buses table .
How can i do this
(If it is related to JDBC i would have set
But what in this case??
Please suggest your ideas .

Save India From Corruption - Anna Hazare.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9924
    
158

Are you using a transaction aware resource (like a datasource) to do the database operations in the EJB method? Or are you using plain JDBC APIs to do the operations?


[My Blog] [JavaRanch Journal]
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi

My application is related to JPA , and i am using DataSource for this .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A Query when using EJB Container Manestaged Transaction
 
Similar Threads
Issue in Inserting / Updating the table with trigger using Hibernate
With respect to using CMT Transactions in SessionBeans and Hibernate
Regarding Hibernate Transactions
EJB Transaction s- Database and JMS
batch insertion into database