gnodet-bot commented on code in PR #28496:
URL: https://github.com/apache/camel/pull/28496#discussion_r4376161779


##########
components/camel-jpa/src/main/java/org/apache/camel/processor/keyvalue/jpa/JpaKeyValueRepository.java:
##########
@@ -476,7 +477,7 @@ public void setDeserializationFilter(String 
deserializationFilter) {
     @Override
     protected void doInit() throws Exception {
         if (transactionStrategy == null) {
-            transactionStrategy = new DefaultTransactionStrategy(null, 
entityManagerFactory);
+            transactionStrategy = JpaHelper.resolveTransactionStrategy(null, 
entityManagerFactory);

Review Comment:
   💭 **Design note:** Same as above for `JpaKeyValueRepository` — `null` 
camelContext bypasses registry auto-discovery. Intentional given the lack of a 
`CamelContext` field in this class?



##########
components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java:
##########
@@ -58,7 +58,7 @@ public class JpaMessageIdRepository extends ServiceSupport 
implements Idempotent
     private boolean sharedEntityManager;
 
     public JpaMessageIdRepository(EntityManagerFactory entityManagerFactory, 
String processorName) {
-        this(entityManagerFactory, 
createDefaultTransactionStrategy(entityManagerFactory), processorName);
+        this(entityManagerFactory, JpaHelper.resolveTransactionStrategy(null, 
entityManagerFactory), processorName);

Review Comment:
   💭 **Design note:** Passing `null` for `camelContext` means the registry is 
never consulted here. Users who register a custom `TransactionStrategy` in the 
Camel registry and use `JpaMessageIdRepository` directly won't get 
auto-discovery. Was this intentional (no `CamelContext` available in 
constructor context), or should a `CamelContext`-aware constructor/factory 
method be added?



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