Skip to content

Commit

Permalink
quarkusio#35806: add new property quarkus.transaction-manager.xa-assu…
Browse files Browse the repository at this point in the history
…me-restore-complete to allow
  • Loading branch information
turing85 committed Sep 9, 2023
1 parent 482501b commit 703bcf6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageSystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
Expand All @@ -80,8 +81,18 @@ class NarayanaJtaProcessor {
private static final String TEST_TRANSACTION = "io.quarkus.test.TestTransaction";

@BuildStep
public NativeImageSystemPropertyBuildItem nativeImageSystemPropertyBuildItem() {
return new NativeImageSystemPropertyBuildItem("CoordinatorEnvironmentBean.transactionStatusManagerEnable", "false");
public List<NativeImageSystemPropertyBuildItem> nativeImageSystemPropertyBuildItem(
TransactionManagerBuildTimeConfiguration buildTimeTransactions) {
return List.of(
new NativeImageSystemPropertyBuildItem("CoordinatorEnvironmentBean.transactionStatusManagerEnable", "false"),
new NativeImageSystemPropertyBuildItem("com.arjuna.ats.jta.xaAssumeRecoveryComplete",
Boolean.toString(buildTimeTransactions.xaAssumeRestoreComplete)));
}

@BuildStep
public SystemPropertyBuildItem systemPropertyBuildItem(TransactionManagerBuildTimeConfiguration buildTimeTransactions) {
return new SystemPropertyBuildItem("com.arjuna.ats.jta.xaAssumeRecoveryComplete",
Boolean.toString(buildTimeTransactions.xaAssumeRestoreComplete));
}

@BuildStep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.quarkus.narayana.jta.deployment;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;

/**
*
*/
@ConfigRoot(name = "transaction-manager", phase = ConfigPhase.BUILD_TIME)
public final class TransactionManagerBuildTimeConfiguration {
/**
* Assume recovery complete when transactions cannot be recovered.
*/
@ConfigItem(defaultValue = "false")
public boolean xaAssumeRestoreComplete;
}

0 comments on commit 703bcf6

Please sign in to comment.