ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Ibatis implicit rollbacks
Date Thu, 26 Jan 2006 16:42:50 GMT
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@ext.cec.eu.int <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 = null;
> try {
>         docs = (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 :
>
>
> <transactionManager type="JDBC" commitRequired="true">
> <dataSource type="SIMPLE">
> <property name="JDBC.Driver" value="${driver}"/>
> <property name="JDBC.ConnectionURL" value="${url}"/>
> <property name="JDBC.Username" value="${username}"/>
> <property name="JDBC.Password" value="${password}"/>
> <property name="JDBC.DefaultAutoCommit" value="true"/>
> <property name="Pool.MaximumActiveConnections" value="10"/>
> <property name="Pool.MaximumIdleConnections" value="5"/>
> <property name="Pool.MaximumCheckoutTime" value="5"/>
> <property name="Pool.MaximumTimeToWait" value="500"/>
> </dataSource>
> </transactionManager>
>
> 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:
>
> <transactionManager commitRequired="true" ....>
>   ...
> </transactionManager>
>
> 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 <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 framework
> > with a junit. We do a simple select and there also we have the same problem.
> > 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
> >
>
>

Mime
View raw message