gnodet-bot commented on code in PR #27681:
URL: https://github.com/apache/camel/pull/27681#discussion_r4245118133
##########
components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java:
##########
@@ -210,6 +211,18 @@ public int processBatch(Queue<Object> exchanges) throws
Exception {
if (exchange.getException() != null) {
// if we failed then throw exception
throw exchange.getException();
+ } else if (exchange.isRollbackOnly() ||
exchange.isRollbackOnlyLast()) {
+ // the route marked the exchange rollback only (there
is no exception): the entity is not
+ // consumed, so the next poll consumes it again
+ if (isTransacted()) {
+ // throw to roll back the whole batch
+ // (the exception must be created before the
exchange is released)
+ throw new RollbackExchangeException(
+ "Rollback transaction due exchange was
marked for rollback only", exchange);
+ }
Review Comment:
💡 **Nit:** Grammar — `due exchange` should be `due to exchange being`:
```suggestion
throw new RollbackExchangeException(
"Rollback transaction due to exchange
being marked for rollback only", exchange);
```
--
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]