camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: JTA Transactions not rolling back in RouteBuilder
Date Tue, 12 May 2009 08:33:05 GMT
On Mon, May 11, 2009 at 3:27 PM, triswork <tristan.koen@gmail.com> wrote:
>
> Hi Claus,
>
> I have created a JIRA ticket for this issue and attached a MVN project that
> demonstrates the issue. The JIR reference is CAMEL-1601.
Hi Tristian

Thanks for reporting it. If you have the time and will please add a
README or instructions in bullet how to reproduce it.
As we really prefer unit test to demonstrate it, but this one requires
to install Glasshfish.

So if you can demonstrate it with for instance JOTM (JTA TX manager
without the need for container) and a unit test that would be perfect.



>
> Regards,
>
> Tristan
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Mon, May 11, 2009 at 7:46 AM, triswork <tristan.koen@gmail.com> wrote:
>>>
>>> I have made some progress with this issue, but I am more confused than
>>> ever...
>>> If I annotate my poll() method with @Transactional(propagation =
>>> Propagation.MANDATORY) I get:
>>> IllegalTransactionStateException: No existing transaction found for
>>> transaction marked with propagation 'mandatory'
>>>
>>> If, however, I rewrite my poll() method to use use programmatic rather
>>> than
>>> declarative transaction support, everything works as expected. The
>>> revised
>>> code is:
>>>
>>> protected void poll() throws Exception {
>>>    PlatformTransactionManager transactionMananger =
>>> endpoint.getTransactionManager();
>>>    DefaultTransactionDefinition def = new DefaultTransactionDefinition();
>>>    TransactionStatus status = transactionMananger.getTransaction(def);
>>>    try {
>>>        List<Map> items =
>>> endpoint.getMessageQueueDao().processQueue(batchSize);
>>>        for (Map m : items) {
>>>            Exchange exchange = endpoint.createExchange();
>>>            exchange.getIn().setBody(m);
>>>            getProcessor().process(exchange);
>>>            transactionMananger.commit(status);
>>>        }
>>>    }
>>>    catch (Exception ex) {
>>>        LOG.error("EXCEPTION THROWN DURING TRANSACTION:" + ex.toString());
>>>        transactionMananger.rollback(status);
>>>    }
>>> }
>>>
>>> Can anyone shed some light on this?
>> Hi
>>
>> I am suspecting that @annotations on your poll() bean class is not
>> picked up by spring.
>>
>> Could you create a sample project (preferred as a maven project) and
>> create a JIRA ticket for this.
>> Then we have a starting point for investigate this and see if there is
>> a gremlin somewhere in Camel.
>>
>>
>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/JTA-Transactions-not-rolling-back-in-RouteBuilder-tp23457761p23477404.html
>>> Sent from the Camel - Users (activemq) mailing list archive at
>>> Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>> Apache Camel Reference Card:
>> http://refcardz.dzone.com/refcardz/enterprise-integration
>> Interview with me:
>> http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress
>>
>>
>
> --
> View this message in context: http://www.nabble.com/JTA-Transactions-not-rolling-back-in-RouteBuilder-tp23457761p23483301.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration
Interview with me:
http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress

Mime
View raw message