davsclaus commented on code in PR #27983: URL: https://github.com/apache/camel/pull/27983#discussion_r4301785754
########## docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc: ########## @@ -452,6 +452,13 @@ again. With `transacted=true` the SQL and MyBatis consumers break out of the bat `markRollbackOnlyLast()` reaches the consumer only when no `transacted()` EIP has consumed the flag, so the consumer's own transaction is the last one. +=== camel-jta - an exchange marked rollback only last rolls back its transaction + +In a `transacted()` route that uses a JTA transaction manager, `markRollbackOnlyLast()` now rolls back the +transaction of that `transacted()` block, as it already did with the camel-spring transaction error handler. Before, +the transaction was committed, and the marker was then cleared, so nothing showed that the rollback was skipped. +The marker is still cleared afterwards, so an outer `transacted()` block does not see it. Review Comment: Optional: it could help to say what happens when the inner `transacted()` joins the outer JTA transaction (`PROPAGATION_REQUIRED` with a different policy bean). The Camel Quarkus `TransactionalJtaTransactionPolicy` then calls `transactionManager.setRollbackOnly()` on the shared transaction, so the outer commit fails (`CamelException: Unable to commit transaction`) where it used to commit. That matches camel-spring (`UnexpectedRollbackException`), and `markRollbackOnlyLast()` only makes sense with an inner `PROPAGATION_REQUIRES_NEW`. One sentence would be enough, for example: "If the inner `transacted()` block joins the outer transaction (`PROPAGATION_REQUIRED`), the whole JTA transaction is now marked rollback only; use `PROPAGATION_REQUIRES_NEW` for the inner block to roll back only that one." -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
