ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Question about transactions.
Date Fri, 18 Mar 2005 17:24:00 GMT
using the following format will work. If your sql fails before commit
the end transaction will call rollback.

try{
  startTransaction
  ... code goes here
  commitTransaction
} finally {
  endTransaciton
}

Brandon

On Fri, 18 Mar 2005 09:18:18 -0800 (PST), Mark Alcocer Flores
<superpchead@yahoo.com> wrote:
> I have a problem. I recently upgraded from the 1.2
> iBatis version to the new 2.0 iBatis version. Because
> of the database I connect to, I controled transactions
> manually. I use the startTransaction method to start
> the transaction and commitTransaction to commit it. If
> anything went wrong I used the rollbackTransaction to
> leave the database in a consistent state. In this new
> version os iBatis the rollbackTransaction method is
> not public and instead, the endTransaction method must
> be use, actually I call it always in a finally
> statement.
> 
> The thing is that when there is an error in the
> database, in the old way, the connection close with
> not problems and everything was alrigth, but with the
> new way, the state of the database is inconsistent
> sometimes and the connection remains open.
> 
> Can anyone give me an idea of what can I do? I think i
> could go back to the old version, but this new version
> has so many good features that i wouldn't want to
> leave  them.
> 
> Thanks in advance.
> 
> Mark.
> 
> The Greatest Thing You'll Ever Learn
> It's Just To Love And Be Loved In Return
> 
>

Mime
View raw message