camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From triswork <tristan.k...@gmail.com>
Subject Re: JTA Transactions not rolling back in RouteBuilder
Date Mon, 11 May 2009 13:27:24 GMT

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.

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.


Mime
View raw message