Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 13913 invoked from network); 22 Apr 2010 21:32:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Apr 2010 21:32:38 -0000 Received: (qmail 2877 invoked by uid 500); 22 Apr 2010 21:32:38 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 2854 invoked by uid 500); 22 Apr 2010 21:32:38 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 2847 invoked by uid 99); 22 Apr 2010 21:32:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Apr 2010 21:32:37 +0000 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=AWL,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.212.181] (HELO mail-px0-f181.google.com) (209.85.212.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Apr 2010 21:32:33 +0000 Received: by pxi19 with SMTP id 19so755024pxi.12 for ; Thu, 22 Apr 2010 14:32:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.201.4 with HTTP; Thu, 22 Apr 2010 14:32:12 -0700 (PDT) In-Reply-To: References: <4BCC93FB.8060802@burntmail.com> <4BCD093F.6090304@burntmail.com> Date: Thu, 22 Apr 2010 14:32:12 -0700 Received: by 10.140.179.20 with SMTP id b20mr697841rvf.246.1271971932294; Thu, 22 Apr 2010 14:32:12 -0700 (PDT) Message-ID: Subject: Re: Transaction management in iBATIS 3 inside an EJB (3.1) container From: Adinath Raveendra Raj To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=000e0cd177da304f370484da0be2 --000e0cd177da304f370484da0be2 Content-Type: text/plain; charset=ISO-8859-1 Clinton, On Tue, Apr 20, 2010 at 7:48 PM, Clinton Begin wrote: > Okay, I've looked around. It is really hard to find the way it's > "supposed" to work, but I don't think it matters. There's more than enough > empirical evidence (both in iBATIS 2 and Adinath's custom implementation). > So I've added the close to the ManagedTransaction. It will log but > otherwise ignore exceptions thrown by close(), to deal with unexpected > states (and re-throwing an exception from close could hide a more important > root cause exception). > It is hard to find info on this, there is a WebSphere (from 2005) article ( http://www.ibm.com/developerworks/websphere/library/techarticles/0506_johnsen/0506_johnsen.html) about this topic that says: *When the application closes a shareable connection, the connection is not truly closed, nor is it returned to the Free pool. Rather, it remains in the Shared connection pool, ready for another request within the same LTC for a connection to the same resource. ** LTC = Local Transaction Containment The funny thing is that I even had a unit test asserting this behavior, so I > must have done it at some point for a reason. I just hope it wasn't a very > good reason. ;-) Haha, been there :) > It's also funny that it wasn't found in 10 betas... which either implies > that not many people use managed transactions, or that some app servers > behave as I thought they would. > > I'm going to recommend a re-build before we take iBATIS 3 to GA, so the > iBATIS release we'll vote on will probably be 3.0.1. > Thanks, I think your changes are going to help others avoid this issue. Keep up the excellent work. Best, Adi -- Acciente, LLC Systems Architecture and Software Design www.acciente.com www.inductionframework.org --000e0cd177da304f370484da0be2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Clinton,

On Tue, Apr 20, 2010 at 7:48 PM, Clinton Begin <clinton.begin@gmail= .com> wrote:
Okay, I've looked around.=A0 It is really hard to find the way it's= "supposed" to work, but I don't think it matters.=A0 There&#= 39;s more than enough empirical evidence (both in iBATIS 2 and Adinath'= s custom implementation).=A0 So I've added the close to the ManagedTran= saction.=A0 It will log but otherwise ignore exceptions thrown by close(), = to deal with unexpected states (and re-throwing an exception from close cou= ld hide a more important root cause exception).

It is hard to find info on this, there is a WebSphere= (from 2005) article (http://www.ibm.com/d= eveloperworks/websphere/library/techarticles/0506_johnsen/0506_johnsen.html= ) about=A0 this topic that says:

When the application closes a shareable connection, the connection i= s not truly closed, nor is it returned to the Free pool. Rather, it=20 remains in the Shared connection pool, ready for another request within=20 the same LTC for a connection to the same resource.

* LTC =3D Lo= cal Transaction Containment

The funny thing is that I even had a unit test asserting this behavior, so = I must have done it at some point for a reason. I just hope it wasn't a= very good reason.=A0 ;-)=A0=A0

Haha, been there :) =A0
It&#= 39;s also funny that it wasn't found in 10 betas... which either implie= s that not many people use=A0 managed transactions, or that some app server= s behave as I thought they would.=A0

I'm going to recommend a re-build before we take iBATIS 3 to GA, so= the iBATIS release we'll vote on will probably be 3.0.1.

Thanks, I think your changes are going to help others avoid thi= s issue. Keep up the excellent work.

Best,
Adi

--
Acciente, LLC
Systems Archit= ecture and Software Design

www.= acciente.com
www.induc= tionframework.org
--000e0cd177da304f370484da0be2--