ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: commitRequired?, DefaultAutoCommit?, SetAutoCommitAllowed?
Date Tue, 27 Jun 2006 20:38:50 GMT
Another thing - DefaultAutoCommit and SetAutoCommitAllowed only apply to the
EXTERNAL transaction manager.  So, the truth table gets a little easier:

If SetAutoCommitAllowed="true", or not specified, then the auto commit
property of the transaction will be set to whatever value you specify in the
DefaultAutoCommit property (false by default).
Else, DefaultAutoCommit is ignored.

commitRequired only applies to the other transaction managers and is
irrelevant for EXTERNAL.

Whew!

Jeff Butler


On 6/27/06, Jeff Butler <jeffgbutler@gmail.com> wrote:
>
>  The answers really depend on the type of transaction manager you are
> using - not the database.
>
> If you use EXTERNAL, then commitRequired is irrelavant - it has no effect.
>
> However, DefaultAutoCommit and SetAutoCommitAllowed still come into play
> because iBATIS may still use these values.  If you specify
> SetAutoCommitAllowed="false", then iBATIS will ignore the value of
> DefaultAutoCommit.  If you set it to "true", or don't specify it, then
> iBATIS WILL set the autocommit property of the connection based on the value
> specified in DefaultAutoCommit.  Confusing enough?
>
> Bottom line - it depends on your transaction manager (your app server),
> more than on your database.  For example, CMT on WebSphere should specify
> EXTERNAL transaction manager and SetAutoCommitAllowed="false".
>
> BMT on WebSphere should specify JTA transaction manager,
> commitRequired="true", ignore the other settings.
>
> Maybe we should start a WIKI page with known working configurations for
> the various app server environments.
>
> Jeff Butler
>
>
>
>
> On 6/27/06, Debasish Dutta Roy <debasish.duttaroy@gmail.com> wrote:
> >
> > I am very confused about the transaction management also. I am not sure
> > either if it works.
> >
> > I am using Oracle 9i and I have made several posts and it does not work.
> > I cannot rollback operations. If I debug inside the daoManager then the code
> > is suppose to roll back for all the contexts in the list. In my case I have
> > defined all the daos inside one context tag. So all the transactions for all
> > the daos should rollback, but it does not happen.
> >
> > Has anyone used DaoManager to rollback successfully with Oracle 9i. I
> > can write down the details of my design and code again if anyone is
> > interested to help.
> >
> > I have used all possible configuration in the xml files. No luck. I am
> > too late to give up iBATIS in my project now.
> >
> >  On 6/27/06, jaybytez <jaybytez@gmail.com > wrote:
> >
> > >
> > > What do these fields do in relation to allowing CMT to handle
> > > transactions in
> > > iBatis?
> > >
> > > The documentation is not totally clear, and from posts that I have
> > > read, I
> > > am not sure if there is conflicting information.  Does
> > > commitRequired="false" mean the container handles the transaction
> > > without
> > > iBatis interaction, or does commitRequired="true" with
> > > DefaultAutoCommit and
> > > SetAutoCommitAllowed mean the container handles the transactions
> > > without
> > > iBatis.
> > >
> > > Here are my two configs and I cannot tell what the difference is
> > > regarding
> > > transactions:
> > >
> > > This is my original configuration:
> > >
> > >     <transactionManager type="EXTERNAL" commitRequired="false">
> > >         <dataSource type="JNDI">
> > >             <property name="DataSource" value="${ fooPool.JNDIName}"
> > > />
> > >         </dataSource>
> > >     </transactionManager>
> > >
> > > This appears to be the suggested configuration:
> > >
> > >     <transactionManager type="EXTERNAL" commitRequired="true">
> > >         <property name="DefaultAutoCommit" value="false"/>
> > >         <property name="SetAutoCommitAllowed" value="false"/>
> > >         <dataSource type="JNDI">
> > >             <property name="DataSource" value="${fooPool.JNDIName }"
> > > />
> > >         </dataSource>
> > >     </transactionManager>
> > >
> > > Thanks,
> > >
> > > jay blanton
> > > --
> > > View this message in context: http://www.nabble.com/commitRequired-%2C-DefaultAutoCommit-%2C-SetAutoCommitAllowed--tf1856695.html#a5070352
> > >
> > > Sent from the iBATIS - User - Java forum at Nabble.com<http://nabble.com/>
> > > .
> > >
> > >
> >
> >
>
>

Mime
View raw message