Dhairya-007 commented on PR #29986: URL: https://github.com/apache/camel/pull/29986#issuecomment-6892346156
You are right, thanks for checking the call site rather than just the read. `JpaPollingConsumer.doReceive` passes a `null` exchange into `getTargetEntityManager`, and `JpaHelper.getTargetEntityManager` guards the option with `if (exchange != null && usePassedInEntityManager)`, so the polling consumer can never take an `EntityManager` off a header — there is no exchange yet at that point. I only matched the `isUsePassedInEntityManager()` read and missed that the argument it feeds is `null`. `sharedEntityManager` is genuinely different, as you say, because `getTargetEntityManager` uses it without an exchange. So `producer,advanced` is correct and documenting it as `advanced` would promise consumers something that is silently ignored. Closing. -- 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]
