You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Ashish Kulkarni <as...@gmail.com> on 2006/05/02 15:12:09 UTC
Is this the right way to use commitment control
Hi
This is what i am doing in my code and want to confirm that it is the right
way to use commitment control
// start commitment control
sqlMapClient.startTransaction();
sqlMapClient.insert("insertCOHeader", coDataBean);
sqlMapClient.insert("insertCOCOmment", coComment);
sqlMapClient.insert("insertCOHeaderNotes", map);
sqlMapClient.insert("insertCOLineNotes", map);
// commit all transcations
sqlMapClient.commitTransaction();
How about dirty read, will this take of it
Ashish
RE: Is this the right way to use commitment control
Posted by Suneeta Thumu <st...@impactmobile.com>.
Can we use sqlMapTransactionManager.startTransaction (), in the similar way
for commitTransaction() and endTransaction()?
Or we should use only sqlMapclienr.startTransaction()?
_____
From: James, Steven [mailto:steven.james@logicacmg.com]
Sent: Tuesday, May 02, 2006 9:15 AM
To: user-java@ibatis.apache.org
Subject: RE: Is this the right way to use commitment control
No you must have this in a try catch finally exception handler. An in the
finally section add endTransaction the code in here decides if a rollback is
called....
try{
sqlMapClient.startTransaction();
sqlMapClient.insert("insertCOHeader", coDataBean);
sqlMapClient.insert("insertCOCOmment", coComment);
sqlMapClient.insert("insertCOHeaderNotes", map);
sqlMapClient.insert("insertCOLineNotes", map);
// commit all transcations
sqlMapClient.commitTransaction();
}catch(Whatever exc e){
//you could of course just throw them so you could miss this part.
}finally{
sqlMapClient.endTransaction();
}
_____
From: Ashish Kulkarni [mailto:ashish.kulkarni13@gmail.com]
Sent: Tue 02/05/2006 14:12
To: user-java@ibatis.apache.org
Subject: Is this the right way to use commitment control
Hi
This is what i am doing in my code and want to confirm that it is the right
way to use commitment control
// start commitment control
sqlMapClient.startTransaction();
sqlMapClient.insert("insertCOHeader", coDataBean);
sqlMapClient.insert("insertCOCOmment", coComment);
sqlMapClient.insert("insertCOHeaderNotes", map);
sqlMapClient.insert("insertCOLineNotes", map);
// commit all transcations
sqlMapClient.commitTransaction();
How about dirty read, will this take of it
Ashish
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
RE: Is this the right way to use commitment control
Posted by "James, Steven" <st...@logicacmg.com>.
No you must have this in a try catch finally exception handler. An in the finally section add endTransaction the code in here decides if a rollback is called....
try{
sqlMapClient.startTransaction();
sqlMapClient.insert("insertCOHeader", coDataBean);
sqlMapClient.insert("insertCOCOmment", coComment);
sqlMapClient.insert("insertCOHeaderNotes", map);
sqlMapClient.insert("insertCOLineNotes", map);
// commit all transcations
sqlMapClient.commitTransaction();
}catch(Whatever exc e){
//you could of course just throw them so you could miss this part.
}finally{
sqlMapClient.endTransaction();
}
________________________________
From: Ashish Kulkarni [mailto:ashish.kulkarni13@gmail.com]
Sent: Tue 02/05/2006 14:12
To: user-java@ibatis.apache.org
Subject: Is this the right way to use commitment control
Hi
This is what i am doing in my code and want to confirm that it is the right way to use commitment control
// start commitment control
sqlMapClient.startTransaction();
sqlMapClient.insert("insertCOHeader", coDataBean);
sqlMapClient.insert("insertCOCOmment", coComment);
sqlMapClient.insert("insertCOHeaderNotes", map);
sqlMapClient.insert("insertCOLineNotes", map);
// commit all transcations
sqlMapClient.commitTransaction();
How about dirty read, will this take of it
Ashish
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.