Dhairya-007 opened a new pull request, #29986:
URL: https://github.com/apache/camel/pull/29986

   ## Problem
   
   `JpaProducer` and `JpaPollingConsumer` resolve their entity manager with the 
same call, passing the same two options:
   
   ```java
   // JpaProducer, line 169
   final EntityManager entityManager = getTargetEntityManager(exchange, 
entityManagerFactory,
           getEndpoint().isUsePassedInEntityManager(), 
getEndpoint().isSharedEntityManager(), true);
   ```
   
   ```java
   // JpaPollingConsumer, line 139
   final EntityManager entityManager = getTargetEntityManager(null, 
entityManagerFactory,
           getEndpoint().isUsePassedInEntityManager(), 
getEndpoint().isSharedEntityManager(), true);
   ```
   
   Their labels disagree:
   
   ```java
   @UriParam(label = "advanced")
   private boolean sharedEntityManager;
   ...
   @UriParam(label = "producer,advanced")
   private boolean usePassedInEntityManager;
   ```
   
   So of the two options read on that one line, the catalog documents 
`sharedEntityManager` for both sides - correctly - and 
`usePassedInEntityManager` for the producer alone, although 
`JpaPollingConsumer` (what `pollEnrich` and `consumer.receive` use against a 
`jpa:` endpoint) reads it identically. Someone using a passed-in 
`EntityManager` with a polling consumer finds the option documented for the 
other side.
   
   ## Fix
   
   Label it `advanced`, like its companion in the same call.
   
   Nothing in the runtime path changes - the polling consumer already reads it. 
The regenerated `jpa.json` files are included; the only change is 
`usePassedInEntityManager` moving from the `producer (advanced)` group to 
`advanced`, which shifts three lines.


-- 
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]

Reply via email to