Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 17187 invoked from network); 26 Jan 2006 16:43:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jan 2006 16:43:47 -0000 Received: (qmail 53235 invoked by uid 500); 26 Jan 2006 16:43:13 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 53200 invoked by uid 500); 26 Jan 2006 16:43:13 -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 53164 invoked by uid 99); 26 Jan 2006 16:43:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2006 08:43:13 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of clinton.begin@gmail.com designates 64.233.162.194 as permitted sender) Received: from [64.233.162.194] (HELO zproxy.gmail.com) (64.233.162.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2006 08:43:11 -0800 Received: by zproxy.gmail.com with SMTP id j2so378122nzf for ; Thu, 26 Jan 2006 08:42:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=nMZRruJb7oGtajUK/O9f42FiFHW/gpPfeNjayg20yfUlDuTqLSufTE9LKmvn2m/UtRoEtv30Xr6Oqd9bTcXzrNbCfXLl6EK2wGxmRPlVuLbvHXm7LmlIr9Um5cqP6IaC33RAPY34nQE0WWNt7qjG/8TvSg13DlTESMAHhpLu+hU= Received: by 10.65.35.2 with SMTP id n2mr1467236qbj; Thu, 26 Jan 2006 08:42:50 -0800 (PST) Received: by 10.64.143.14 with HTTP; Thu, 26 Jan 2006 08:42:50 -0800 (PST) Message-ID: <16178eb10601260842x38bc7488n856c778dcb8308d6@mail.gmail.com> Date: Thu, 26 Jan 2006 09:42:50 -0700 From: Clinton Begin To: user-java@ibatis.apache.org Subject: Re: Ibatis implicit rollbacks In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8698_1374508.1138293770723" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_8698_1374508.1138293770723 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline iBATIS will do a rollback by default. Unfortunately this is a hangover for legacy drivers (e.g. Sybase) that require a rollback to reset the connectio= n so that it can be reused. Try using the DBCP connection pool instead. If that doesn't help, try using a container managed transaction. As a last resort, you can write your own transaction manager and/or connector to a different 3rd party connection pool to achieve the behaviour that you want. You can use the existing implementations as a guide, or eve= n as a base for developing your own. You can configure iBATIS to use your custom implementations by simply replacing JDBC and SIMPLE with the fully qualified classnames of your implementations. Cheers, Clinton On 1/26/06, Hilde.DE-GRAEVE@ext.cec.eu.int wrote: > > I made the recommended change but still have the same problem. With a > simple query it still does a rollback in oracle there is however no error= in > java or oracle. > > To call the query I'm using the follwing code without any transaction > because it is a simple select : > > > List docs =3D null; > try { > docs =3D (List) sqlMap.queryForList("getquerytest",null ); > System.out.println(docs); > > } catch (RuntimeException e) { > e.printStackTrace(); > } catch (SQLException e) { > e.printStackTrace(); > } catch (Exception e) { > e.printStackTrace(); > } > > > For info my SQLMapConfig has the following properties for the transaction > manager : > > > > > > > > > > > > > > > > > Anyone an ideia? > > Thanks, > > Hilde > > > > -----Original Message----- > *From:* Jeff Butler [mailto:jeffgbutler@gmail.com] > *Sent:* Wednesday, January 25, 2006 6:04 PM > *To:* user-java@ibatis.apache.org > *Subject:* Re: Ibatis implicit rollbacks > > Are you using an EXTERNAL transaction manager? If not, read on... > > iBATIS will start, but not commit, transactions for selects by default. > If this is happening, some transaction managers will try to automatically > rollback uncommitted transactions. This sounds like the kind of problem = you > are having. To change this behavior, specify "commitRequired" on your > transaction manage like this: > > > ... > > > Maybe this is the problem? But this does not apply to EXTERNAL > transaction managers. > > Jeff Butler > > > > On 1/25/06, Hilde.DE-GRAEVE@ext.cec.eu.int > wrote: > > > > Dear, > > We have an application that uses Ibatis and Spring. As database we are > > using Oracle 9. > > The problem is that for each select we launch without a transaction, > > there is a roolback done in oracle. No error trace in java or Oracle. > > > > We then created another project where we simply use the ibatis framewor= k > > with a junit. We do a simple select and there also we have the same pro= blem. > > Oracle performs a rollback. > > > > We already have several projects where we use the same configuration, > > schema , and user and there everything is ok. > > Is like there is a setting in the project that provoques the roolback. > > We also created some other test projects in other computers/servers and= we > > still have the problem. > > > > Are you aware of this problem caused by Ibatis? Could it be a problem > > with Oracle? > > Thnak you very much. > > Best regards, > > Hilde De Graeve > > > > ------=_Part_8698_1374508.1138293770723 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
iBATIS will do a rollback by default.  Unfortunately this is a hangover for legacy drivers (e.g. Sybase) that require a rollback to reset the connection so that it can be reused.  Try using the DBCP connection pool instead.  If that doesn't help, try using a container managed transaction. 

As a last resort, you can write your own transaction manager and/or connector to a different 3rd party connection pool to achieve the behaviour that you want.  You can use the existing implementations as a guide, or even as a base for developing your own.  You can configure iBATIS to use your custom implementations by simply replacing JDBC and SIMPLE with the fully qualified classnames of your implementations.

Cheers,
Clinton



On 1/26/06, Hilde.DE-GRAEVE@e= xt.cec.eu.int <Hilde.DE-GRAEVE@ext.cec.eu.int > wrote:
I made the=20 recommended change but still have the same problem. With a simple query it = still=20 does a rollback in oracle there is however no error in java or=20 oracle.
 
To call the query=20 I'm using the follwing code without any transaction because it is a simple= =20 select :
 
 
List docs =3D=20 null;
try=20 {
        docs =3D (List)=20 sqlMap.queryForList("getquerytest",null=20 );
       =20 System.out.println(docs);
   
    =   }=20 catch (RuntimeException e) {
       = =20
e.printStackTrace();=
  &nbs= p; } catch=20 (SQLException e) {
       =20 e.printStackTrace();
   } catch (Exception e)=20 {
  &nb= sp;    =20 e.printStackTrace();
   }
 
 
For info my=20 SQLMapConfig has the following properties for the transaction manager=20 :
 

<transactionManager type=3D"JDBC"=20 commitRequired=3D"true">
<dataSource type=3D"SIMPLE= ">
<property=20 name=3D"JDBC.Driver" value=3D"${driver}"/>
<pr= operty=20 name=3D"JDBC.ConnectionURL" value=3D"${url}"/>
&l= t;property=20 name=3D"JDBC.Username" value=3D"${username}"/>
&l= t;property=20 name=3D"JDBC.Password" value=3D"${password}"/>
&l= t;property=20 name=3D"JDBC.DefaultAutoCommit" value=3D"true"/>
= <property=20 name=3D"Pool.MaximumActiveConnections" value=3D"10"/>= ;
<property=20 name=3D"Pool.MaximumIdleConnections" value=3D"5"/> <= br><property=20 name=3D"Pool.MaximumCheckoutTime" value=3D"5"/>
= <property=20 name=3D"Pool.MaximumTimeToWait"=20 value=3D"500"/>
</dataSource>
</transactionMana= ger>

Anyone an=20 ideia?

Thanks,

Hilde

 

-----Original Message-----
From: Jeff Butler=20 [mailto:jeffgbutler@gmail.com]
Sent: Wednesday, January 25, 2006=20 6:04 PM
To:
user= -java@ibatis.apache.org
Subject: Re:=20 Ibatis implicit rollbacks

Are you using an EXTERNAL transaction manager?  If not, read=20 on...
 
iBATIS will start, but not commit, transactions for= =20 selects by default.  If this is happening, some transaction managers= will=20 try to automatically rollback uncommitted transactions.  This s= ounds=20 like the kind of problem you are having.  To change this behavior,= =20 specify "commitRequired" on your transaction manage like this: =
 
<transactionManager commitRequired=3D"true" ....>
  ...
</transactionManager>
 
Maybe this is the problem?  But this does not apply to EXTERNAL= =20 transaction managers.
 
Jeff Butler


 
On 1/25/06, Hilde.DE-GRAEVE@ext.cec= .eu.int =20 <Hilde.DE-GRAEVE@ext= .cec.eu.int=20 > wrote:=20

Dear,=20
We have an application that = uses Ibatis=20 and Spring. As database we are using Oracle 9.
The problem is=20 that for each select we launch without a transaction, there is a roolba= ck=20 done in oracle. No error trace in java or Oracle.

We then created another project wher= e we simply=20 use the ibatis framework with a junit. We do a simple select and there = also=20 we have the same problem. Oracle performs a rollback.

We already have several projects whe= re we use the=20 same configuration, schema , and user and there everything is=20 ok.
Is like there is a setting in the project that provoques the= =20 roolback. We also created some other test projects in other=20 computers/servers and we still have the problem.

Are you aware of this problem caused= by Ibatis?=20 Could it be a problem with Oracle?=20
Thnak you very much.<= font face=3D"Times New Roman">
B= est=20 regards,
Hilde De Graeve=20



------=_Part_8698_1374508.1138293770723--