From: Rajaram_Viswanathan
Sent: Fri 4/28/2006 4:27 PM
To: [email protected]
Subject: FW: Ibatis Transactions across multiple DAO objects
From: Rajaram_Viswanathan
Sent: Fri 4/28/2006 12:22 PM
To: [email protected]
Subject: Ibatis Transactions across multiple DAO objects
class Myservice extends BaseService{
public Bean insertPrimaryContent(Bean
bean)
{
try{
daoManager.startTransaction();
//This function is available in the base service class using the baseDao object obtained
//using getDao(BaseDao.class) method in base service.
super.callGenericInsertStoredProc();
//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
.....
daoManager.commitTransaction();
}finally{
daoManager.endTransaction();
}
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.
DISCLAIMER:
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..
