On Fri, Nov 4, 2011 at 10:57 AM, Christian Schneider
<ch...@die-schneider.net> wrote:
> Well so it is code in spring that tries to commit. Still I would rather
> expect that the transaction should be rolled back.
>

Spring TX is weird. Even if you mark the TX for rollback only, it may
still commit it.
The solution is to throw a runtime exception in the doInTransaciton
method, like we do in the Camel TransactionErrorHandler.
That's possible what is missing in the camel-jpa, which possible have
a doInTransaction method or something like that.



> Christian
>
> Am 04.11.2011 10:24, schrieb bvahdat:
>>
>> Hi Christian,
>>
>> IMHO one can easily see that it's not camel trying to commit the
>> transaction
>> (in contrast to what you claimed) but the current spring
>> PlatformTransactionManager in charge, in this given case it's spring
>> JpaTransactionManager, the relevant part by the stacktrace is:
>>
>> ...
>> at
>>
>> org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
>> at
>>
>> org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
>> at
>>
>> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
>> ...
>>
>> In contrary camel's TransactionErrorHandler.processInTransaction() clearly
>> warns about the current transaction getting rolled back:
>>
>> ...
>> [rip.adapters.rap.PublicationIn] TransactionErrorHandler        WARN
>> Transaction rollback (0x5113f0) for ExchangeId:
>> ID-W14523-2657-1320391149162-0-141
>> ...
>>
>> On the other hand there's not much I can say regarding the misleading jmx
>> statistics but as far as I remember there was some added support for the
>> JMX-notifications introduced in:
>>
>> https://issues.apache.org/jira/browse/CAMEL-4516
>>
>> @Omar Atia: I think you're in the wrong chat-room ;-)
>>
>> Regards, Babak
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963451.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to