You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Christian Müller (Closed JIRA)" <ji...@apache.org> on 2012/04/12 00:05:16 UTC

[jira] [Closed] (CAMEL-5161) If MyBatis experiences an error on commit (e.g. unique PK violation) it appears to hold the session open and cause DB writelock errors

     [ https://issues.apache.org/jira/browse/CAMEL-5161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller closed CAMEL-5161.
-----------------------------------

    Resolution: Fixed
    
> If MyBatis experiences an error on commit (e.g. unique PK violation) it appears to hold the session open and cause DB writelock errors
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-5161
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5161
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mybatis
>    Affects Versions: 2.10.0
>            Reporter: Aaron Daubman
>            Assignee: Christian Müller
>              Labels: exception, mybatis, sql
>             Fix For: 2.8.5, 2.9.2, 2.10.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> When MyBatis experiences an error committing a statement the session.close() is not called and the DB is caught in a writelock state until camel is exited.
> I have not tested a fix yet, but I believe that if, in: camel/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java
> session.commit() is placed in a try/catch block with session.close() in its finally it will ensure the session is closed even when MyBatis throws an exception during a commit.
> One of the exceptions I've experienced this with is 'java.sql.BatchUpdateException' where a row was attempting to be inserted with a field that violated a table's unique index constraint.
> I should be able to submit a patch later this week if necessary.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira