Skip to content

Commit

Permalink
Fix #3914 to get TransactionManager and UserTransaction from Arc cont…
Browse files Browse the repository at this point in the history
…ainer
  • Loading branch information
zhfeng authored and ppalaga committed Jul 13, 2022
1 parent 73a1dcb commit d94de00
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;

import io.quarkus.arc.Arc;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;
import org.apache.camel.component.jpa.JpaComponent;
Expand All @@ -28,8 +29,8 @@
public class CamelJpaRecorder {

public RuntimeValue<JpaComponent> createJpaComponent() {
TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
UserTransaction userTransaction = com.arjuna.ats.jta.UserTransaction.userTransaction();
TransactionManager transactionManager = Arc.container().instance(TransactionManager.class).get();
UserTransaction userTransaction = Arc.container().instance(UserTransaction.class).get();

JpaComponent component = new JpaComponent();
component.setTransactionManager(new JtaTransactionManager(userTransaction, transactionManager));
Expand Down

0 comments on commit d94de00

Please sign in to comment.