From f8e715a52592f9b865d1671e4472f362a736f63d Mon Sep 17 00:00:00 2001 From: Zheng Feng Date: Mon, 29 Apr 2024 17:14:26 +0800 Subject: [PATCH] Revert "Move setDefaultProperties in the static init" This reverts commit aef89d627fbd398415caa2152cc550916762ea4b. --- .../jta/deployment/NarayanaJtaProcessor.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java b/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java index 135e39150cd2a..396279af870c0 100644 --- a/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java +++ b/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java @@ -1,7 +1,6 @@ package io.quarkus.narayana.jta.deployment; import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT; -import static io.quarkus.deployment.annotations.ExecutionTime.STATIC_INIT; import java.util.List; import java.util.Map; @@ -138,16 +137,6 @@ public void build(NarayanaJtaRecorder recorder, builder.addBeanClass(TransactionalInterceptorNotSupported.class); additionalBeans.produce(builder.build()); - // This must be done before setNodeName as the code in setNodeName will create a TSM based on the value of this property - recorder.disableTransactionStatusManager(); - recorder.setNodeName(transactions); - recorder.setDefaultTimeout(transactions); - recorder.setConfig(transactions); - } - - @BuildStep - @Record(STATIC_INIT) - public void setProperties(NarayanaJtaRecorder recorder) { //we want to force Arjuna to init at static init time Properties defaultProperties = PropertiesFactory.getDefaultProperties(); //we don't want to store the system properties here @@ -156,6 +145,11 @@ public void setProperties(NarayanaJtaRecorder recorder) { defaultProperties.remove(i); } recorder.setDefaultProperties(defaultProperties); + // This must be done before setNodeName as the code in setNodeName will create a TSM based on the value of this property + recorder.disableTransactionStatusManager(); + recorder.setNodeName(transactions); + recorder.setDefaultTimeout(transactions); + recorder.setConfig(transactions); } @BuildStep