ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: DaoManager Transaction problem
Date Thu, 10 May 2007 14:28:02 GMT
Is it MySQL?

Larry


On 5/10/07, ohsuria@gmail.com <ohsuria@gmail.com> wrote:
> 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.
>

Mime
View raw message