Dear Experts,
I am trying to use Transaction with iBatis DaoManager.
I need to make sure all deletion must be completed or the transaction should
be roll-backed.
Here is my bean:
---------------------------------------------------------------------------
public void deleteF0002(List p_listF0002) {
try {
F0002 objF0002;
daoManager.startTransaction();
if (p_listF0002.size() > 0) {
for (int i = 0; i < p_listF0002.size(); i++) {
objF0002 = (F0002) p_listF0002.get(i);
objF0002DAO.deleteByPrimaryKey(objF0002.getCityid());
}
}
//daoManager.commitTransaction();
} finally {
daoManager.endTransaction();
}
}
---------------------------------------------------------------------------
I remark the commitTransaction() just for testing purpose..
I thought the deletion process will be roll-backed, since the
commitTransaction() is not triggered.
Well I am wrong.. it still deletes records.
Can anyone help me on this? why the transaction doesn't roll-backed?
Thanks in advance.