ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suneeta Thumu" <sth...@impactmobile.com>
Subject RE: Is this the right way to use commitment control
Date Tue, 02 May 2006 13:28:11 GMT
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.



Mime
View raw message