ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Moores" <jonathan.moo...@gmail.com>
Subject RE: Transactions and Pooling
Date Sat, 24 Jan 2009 08:00:36 GMT
But in order to know if something went wrong wouldn't you normally have a
catch block?

Is there some documentation / reasoning on the recommended pattern?
Thanks
Jon

-----Original Message-----
From: Clinton Begin [mailto:clinton.begin@gmail.com] 
Sent: zaterdag 24 januari 2009 5:12
To: user-java@ibatis.apache.org
Subject: Re: Transactions and Pooling

The reason is so that you can implement the recommended coding pattern:

try {
  // start transaction
  // commit transaction
} finally {
  // end transaction
}

If you called commit OR end/rollback, you'd have to use a catch
block.... which sux. :-)

Cheers,
Clinton

On Fri, Jan 23, 2009 at 5:17 PM, Jonathan Moores
<jonathan.moores@gmail.com> wrote:
> Hi,
>
> I was wondering why there is a need to explicitly call
> SqlMapClient.endTransaction() in order to return a connection to the pool
> even after a commitTransaction()?
>
>
>
> I am using Tomcat 6.018 with Ibatis 2.34.726 and I see that the
connections
> used in a transaction are never returned without the endTransaction() call
> which I actually equated to a rollback.
>
>
>
> Thanks
>
> Jon


Mime
View raw message