ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajaram_Viswanathan" <Rajaram_Viswanat...@Satyam.com>
Subject FW: Ibatis Transactions across multiple DAO objects
Date Fri, 28 Apr 2006 10:57:28 GMT


From: Rajaram_Viswanathan
Sent: Fri 4/28/2006 12:22 PM
To: user-java@ibatis.apache.org
Subject: Ibatis Transactions across multiple DAO objects

Hello All,
I wanted to control  ibatis transactions manually in my application.
I had used daoManagaer.StartTransaction/endTransaction().
Following is the code:
This code is in a service class which would be called by the action class to do insert operations

class Myservice extends BaseService{

public Bean insertPrimaryContent(Bean bean)

//This function is available in the base service class using the baseDao object obtained 

//using getDao(BaseDao.class)   method    in    base service.       


     //Updations are done seperately on the inserted data.

     //This below functions are in this class and uses myDao obtained using getDao(MyDao.class)
method in category   service

     UpdateRelatedProperities();  //Mark 1

     UpdateRelatedTables();         //Mark 2

  return bean;



Since I handle transactions manually,commit is not done in my stored procs.

But if any of the exception occurs at Mark 1 or Mark 2(see comments) ,The operations done
by the callGenericInsertStoredProc() is not rolled back but mark1 and mark2 operations are
rolled back.

Can you please tell me how to solve this problem?

I want all the above things to happen as single atomic transaction(All or None).

Please let me know if you have solution for the above problem.


This email (including any attachments) is intended for the sole use of the intended recipient/s
and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review
or reliance by others or copying or distribution or forwarding of any or all of the contents
in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard is appreciated.

View raw message