diff --git a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java index 2f0b8ee5cdaa6..22b9f8c5febab 100644 --- a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java +++ b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java @@ -18,6 +18,9 @@ @Dependent public class NarayanaJtaProducers { + private static final javax.transaction.UserTransaction USER_TRANSACTION = UserTransaction.userTransaction(); + private static final javax.transaction.TransactionManager TRANSACTION_MANAGER = TransactionManager.transactionManager(); + @Produces @ApplicationScoped public UserTransactionRegistry userTransactionRegistry() { @@ -27,14 +30,13 @@ public UserTransactionRegistry userTransactionRegistry() { @Produces @ApplicationScoped public javax.transaction.UserTransaction userTransaction() { - return UserTransaction.userTransaction(); + return USER_TRANSACTION; } @Produces @ApplicationScoped public XAResourceRecoveryRegistry xaResourceRecoveryRegistry() { return new RecoveryManagerService(); - } @Produces @@ -46,7 +48,7 @@ public TransactionSynchronizationRegistry transactionSynchronizationRegistry() { @Produces @ApplicationScoped public javax.transaction.TransactionManager transactionManager() { - return TransactionManager.transactionManager(); + return TRANSACTION_MANAGER; } @Produces