You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by raffi <ra...@gmail.com> on 2016/07/03 23:52:42 UTC

Why does JPA batch update rollback transaction on single record failure?

We're using the following to aggregate messages containing objects bound for
JPA/Hibernate endpoint.  The problem we have is managing failures; if a
single record fails, the entire batch rolls back, and it's difficult to
identify which record actually failed. Would be nice if BatchUpdateException
was thrown to help identify the bad apple. We tried enabling/disabling
autocommit, made no difference. Is there no option to selectively rollback
bad records?

<route id="toJpaAggregator">
    <from uri="seda:whatever" />
    <aggregate  strategyRef="myAggregator" 
                completionSize="75" 
                completionInterval="10000" 
                forceCompletionOnStop="true">
        <correlationExpression>
            <constant>true</constant>
        </correlationExpression>
        <to uri="jpa:?entityType=java.util.ArrayList" />
    </aggregate>
</route>



--
View this message in context: http://camel.465427.n5.nabble.com/Why-does-JPA-batch-update-rollback-transaction-on-single-record-failure-tp5784690.html
Sent from the Camel - Users mailing list archive at Nabble.com.