ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James, Steven" <steven.ja...@logicacmg.com>
Subject RE: Is this the right way to use commitment control
Date Tue, 02 May 2006 13:15:04 GMT
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.

Mime
View raw message