You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by jaybytez <ja...@gmail.com> on 2006/06/26 21:57:47 UTC

Failed transaction commits half of transaction

I am using iBatis on another subproject that querys/deletes/insert from three
separate schemas in one container managed transaction.  The full process
works correctly...except if a RuntimeException occurs midway, then the
container should rollback the entire transaction...this is how it normally
works.  Unfortunately it appears that half the transaction was committed.  I
have a sqlMap configuration file for each connection.  And each
configuration looks the same:

<sqlMapConfig>
    <settings cacheModelsEnabled="true" enhancementEnabled="true"
        lazyLoadingEnabled="true" errorTracingEnabled="false"
        maxRequests="32" maxSessions="10"
        maxTransactions="5" useStatementNamespaces="false" />

    <transactionManager type="EXTERNAL" commitRequired="false">
        <dataSource type="JNDI">
            <property name="DataSource" value="${fooDbPool.JNDIName}" />
        </dataSource>
    </transactionManager>

Does this maybe have to do with the commitRequired?

Thanks,

-jay blanton

    <!-- Identify all SQL Map XML files to be loaded by this
        SQL map.  Notice the paths are relative to the classpath. -->
    <sqlMap resource="ibatis/mappings/foo/ProviderFacilityDAO.xml" />
    <sqlMap resource="ibatis/mappings/foo/ProviderZipCodeRegionsDAO.xml" />

</sqlMapConfig>
--
View this message in context: http://www.nabble.com/Failed-transaction-commits-half-of-transaction-t1851138.html#a5053827
Sent from the iBATIS - User - Java forum at Nabble.com.


Re: Failed transaction commits half of transaction

Posted by Debasish Dutta Roy <de...@gmail.com>.
hi
I pretty much do the exact thing but my transaction does not rollback if
there is any sql exception. And also my scenario is lot simpler. One schema,
Oracle, Tomcat Jndi, standard stuff.

Do you have anything in web.xml. Did you remove the reference of the
datasource from web.xml?

On 6/26/06, jaybytez <ja...@gmail.com> wrote:
>
>
> I made the following changes and it appears to have fixed the issue:
>
> <sqlMapConfig>
>     <settings cacheModelsEnabled="true" enhancementEnabled="true"
>         lazyLoadingEnabled="true" errorTracingEnabled="false"
>         maxRequests="32" maxSessions="10"
>         maxTransactions="5" useStatementNamespaces="false" />
>
>     <transactionManager type="EXTERNAL" commitRequired="true">
>         <property name="DefaultAutoCommit" value="false"/>
>         <property name="SetAutoCommitAllowed" value="false"/>
>         <dataSource type="JNDI">
>             <property name="DataSource" value="${fooDbPool.JNDIName}" />
>         </dataSource>
>     </transactionManager>
>
>     <!-- Identify all SQL Map XML files to be loaded by this
>         SQL map.  Notice the paths are relative to the classpath. -->
>     <sqlMap resource="ibatis/mappings/foo/ProviderFacilityDAO.xml" />
>     <sqlMap resource="ibatis/mappings/foo/ProviderZipCodeRegionsDAO.xml"
> />
>
> </sqlMapConfig>
>
> Now my distributed transaction is properly working between the three
> schemas.
>
> Thanks,
>
> -jay
> --
> View this message in context:
> http://www.nabble.com/Failed-transaction-commits-half-of-transaction-t1851138.html#a5056529
> Sent from the iBATIS - User - Java forum at Nabble.com.
>
>

Re: Failed transaction commits half of transaction

Posted by jaybytez <ja...@gmail.com>.
I made the following changes and it appears to have fixed the issue:

<sqlMapConfig>
    <settings cacheModelsEnabled="true" enhancementEnabled="true"
        lazyLoadingEnabled="true" errorTracingEnabled="false"
        maxRequests="32" maxSessions="10"
        maxTransactions="5" useStatementNamespaces="false" />

    <transactionManager type="EXTERNAL" commitRequired="true">
        <property name="DefaultAutoCommit" value="false"/>
        <property name="SetAutoCommitAllowed" value="false"/> 
        <dataSource type="JNDI">
            <property name="DataSource" value="${fooDbPool.JNDIName}" />
        </dataSource>
    </transactionManager>

    <!-- Identify all SQL Map XML files to be loaded by this
        SQL map.  Notice the paths are relative to the classpath. -->
    <sqlMap resource="ibatis/mappings/foo/ProviderFacilityDAO.xml" />
    <sqlMap resource="ibatis/mappings/foo/ProviderZipCodeRegionsDAO.xml" />

</sqlMapConfig>

Now my distributed transaction is properly working between the three
schemas.

Thanks,

-jay
--
View this message in context: http://www.nabble.com/Failed-transaction-commits-half-of-transaction-t1851138.html#a5056529
Sent from the iBATIS - User - Java forum at Nabble.com.