Additional settings for JTA TX and Quarkus
This commit is contained in:
parent
9719e1d210
commit
fb855538fa
2 changed files with 2 additions and 2 deletions
|
@ -314,6 +314,7 @@ class KeycloakProcessor {
|
||||||
defaultSchema.ifPresent(ds -> unitProperties.setProperty(AvailableSettings.DEFAULT_SCHEMA, ds));
|
defaultSchema.ifPresent(ds -> unitProperties.setProperty(AvailableSettings.DEFAULT_SCHEMA, ds));
|
||||||
|
|
||||||
unitProperties.setProperty(AvailableSettings.JAKARTA_TRANSACTION_TYPE, PersistenceUnitTransactionType.JTA.name());
|
unitProperties.setProperty(AvailableSettings.JAKARTA_TRANSACTION_TYPE, PersistenceUnitTransactionType.JTA.name());
|
||||||
|
descriptor.setTransactionType(PersistenceUnitTransactionType.JTA);
|
||||||
|
|
||||||
final Optional<String> lockTimeoutConfigValue = getOptionalValue("spi-map-storage-jpa-lock-timeout");
|
final Optional<String> lockTimeoutConfigValue = getOptionalValue("spi-map-storage-jpa-lock-timeout");
|
||||||
lockTimeoutConfigValue.ifPresent(v -> unitProperties.setProperty(AvailableSettings.JAKARTA_LOCK_TIMEOUT, v));
|
lockTimeoutConfigValue.ifPresent(v -> unitProperties.setProperty(AvailableSettings.JAKARTA_LOCK_TIMEOUT, v));
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.keycloak.quarkus.runtime.transaction;
|
||||||
|
|
||||||
import jakarta.enterprise.inject.spi.CDI;
|
import jakarta.enterprise.inject.spi.CDI;
|
||||||
import jakarta.transaction.TransactionManager;
|
import jakarta.transaction.TransactionManager;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.keycloak.Config;
|
import org.keycloak.Config;
|
||||||
import org.keycloak.models.KeycloakSessionFactory;
|
import org.keycloak.models.KeycloakSessionFactory;
|
||||||
|
@ -39,7 +38,7 @@ public class QuarkusJtaTransactionManagerLookup implements JtaTransactionManager
|
||||||
tm = CDI.current().select(TransactionManager.class).get();
|
tm = CDI.current().select(TransactionManager.class).get();
|
||||||
logger.tracev("TransactionManager = {0}", tm);
|
logger.tracev("TransactionManager = {0}", tm);
|
||||||
if (tm == null) {
|
if (tm == null) {
|
||||||
logger.debug("Could not locate JTA TransactionManager. JTA transactions not supported.");
|
throw new RuntimeException("You must provide JTA TransactionManager as the default transaction type is JTA");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue