This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 9346ec20c1a CAMEL-18742 - camel-jpa: deprecated transactionManager 
(#9034)
9346ec20c1a is described below

commit 9346ec20c1af108095fd799b5f029c30729b767a
Author: Zheng Feng <zh.f...@gmail.com>
AuthorDate: Wed Jan 11 03:45:38 2023 +0800

    CAMEL-18742 - camel-jpa: deprecated transactionManager (#9034)
---
 .../src/generated/resources/org/apache/camel/component/jpa/jpa.json   | 2 +-
 .../src/main/java/org/apache/camel/component/jpa/JpaComponent.java    | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-jpa/src/generated/resources/org/apache/camel/component/jpa/jpa.json
 
b/components/camel-jpa/src/generated/resources/org/apache/camel/component/jpa/jpa.json
index 03a6e475fb5..c88de42202c 100644
--- 
a/components/camel-jpa/src/generated/resources/org/apache/camel/component/jpa/jpa.json
+++ 
b/components/camel-jpa/src/generated/resources/org/apache/camel/component/jpa/jpa.json
@@ -26,7 +26,7 @@
     "entityManagerFactory": { "kind": "property", "displayName": "Entity 
Manager Factory", "group": "common", "label": "", "required": false, "type": 
"object", "javaType": "javax.persistence.EntityManagerFactory", "deprecated": 
false, "autowired": false, "secret": false, "description": "To use the 
EntityManagerFactory. This is strongly recommended to configure." },
     "joinTransaction": { "kind": "property", "displayName": "Join 
Transaction", "group": "common", "label": "", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": true, "description": "The camel-jpa component 
will join transaction by default. You can use this option to turn this off, for 
example if you use LOCAL_RESOURCE and join transaction doesn't work with your 
JPA provider. This option can also be set [...]
     "sharedEntityManager": { "kind": "property", "displayName": "Shared Entity 
Manager", "group": "common", "label": "", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": false, "description": "Whether to use Spring's 
SharedEntityManager for the consumer\/producer. Note in most cases 
joinTransaction should be set to false as this is not an EXTENDED 
EntityManager." },
-    "transactionManager": { "kind": "property", "displayName": "Transaction 
Manager", "group": "common", "label": "", "required": false, "type": "object", 
"javaType": "org.springframework.transaction.PlatformTransactionManager", 
"deprecated": false, "autowired": false, "secret": false, "description": "To 
use the PlatformTransactionManager for managing transactions." },
+    "transactionManager": { "kind": "property", "displayName": "Transaction 
Manager", "group": "common", "label": "", "required": false, "type": "object", 
"javaType": "org.springframework.transaction.PlatformTransactionManager", 
"deprecated": true, "autowired": false, "secret": false, "description": "To use 
the PlatformTransactionManager for managing transactions." },
     "transactionStrategy": { "kind": "property", "displayName": "Transaction 
Strategy", "group": "common", "label": "", "required": false, "type": "object", 
"javaType": "org.apache.camel.component.jpa.TransactionStrategy", "deprecated": 
false, "autowired": false, "secret": false, "description": "To use the 
TransactionStrategy for running the operations in a transaction." },
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error 
Handler", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Allows for bridging the 
consumer to the Camel routing Error Handler, which mean any exceptions occurred 
while the consumer is trying to pickup incoming messages, or the likes, will 
now be processed as a me [...]
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start 
Producer", "group": "producer", "label": "producer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Whether the producer 
should be started lazy (on the first message). By starting lazy you can use 
this to allow CamelContext and routes to startup in situations where a producer 
may otherwise fail during star [...]
diff --git 
a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
 
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
index 29447f38515..a7ac052e3d4 100644
--- 
a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
+++ 
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
@@ -45,6 +45,7 @@ public class JpaComponent extends DefaultComponent {
 
     @Metadata
     private EntityManagerFactory entityManagerFactory;
+    @Deprecated
     @Metadata
     private PlatformTransactionManager transactionManager;
     @Metadata
@@ -73,13 +74,16 @@ public class JpaComponent extends DefaultComponent {
         this.entityManagerFactory = entityManagerFactory;
     }
 
+    @Deprecated
     public PlatformTransactionManager getTransactionManager() {
         return transactionManager;
     }
 
     /**
      * To use the {@link PlatformTransactionManager} for managing transactions.
+     * @deprecated - use {@link #setTransactionStrategy(TransactionStrategy)} 
instead
      */
+    @Deprecated
     public void setTransactionManager(PlatformTransactionManager 
transactionManager) {
         this.transactionManager = transactionManager;
     }

Reply via email to