Transactional Client - Doesnt set rollbackonly
----------------------------------------------

                 Key: CAMEL-645
                 URL: https://issues.apache.org/activemq/browse/CAMEL-645
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 1.4.0
            Reporter: Claus Ibsen
             Fix For: 1.5.0


The Camel TOE pattern - you have to see its wikipedia definition;)
http://activemq.apache.org/camel/transactional-client.html

And this user forum thread:
http://www.nabble.com/Transaction-policy-not-correctly-rolling-back-on-exception.-td18173845s22882.html

Got myself so much puzzled that I had to use some time indoor on a windy Sunday 
afternoon. 

The Camel TransactionInterceptor that handles the policy() DSL and does the 
wrapping in the spring transaction template is as below:

{code}
    public void process(final Exchange exchange) {
        LOG.info("transaction begin");

        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus 
status) {
                try {
                    processNext(exchange);
                } catch (Exception e) {
                    throw new RuntimeCamelException(e);
                }
            }
        });

        LOG.info("transaction commit");
    }
{code}

But I am very confused as it doesn't handle any failures etc.
Reading some of the extensive spring documentation at:
http://static.springframework.org/spring/docs/2.5.x/reference/transaction.html

I got the impression that we should handle this problematically in Camel.
That we should check for these conditions:
- exchange.failed => rollback
- exception thrown => rollback (* and should we rethrow? - I guess not)

I am working on some unit tests and a patch. We actually don't have any unit 
tests converting this - or at least I couldn't find any.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to