Skip to content

Commit

Permalink
Merge pull request #40250 from zhfeng/narayana_jta_set_properties
Browse files Browse the repository at this point in the history
Move setDefaultProperties in the static init
  • Loading branch information
gastaldi authored Apr 24, 2024
2 parents e2b7ae7 + aef89d6 commit aaf9d01
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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;
Expand Down Expand Up @@ -137,6 +138,16 @@ 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
Expand All @@ -145,11 +156,6 @@ public void build(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
Expand Down

0 comments on commit aaf9d01

Please sign in to comment.