use of org.keycloak.transaction.JtaTransactionWrapper in project keycloak by keycloak.
the class DefaultKeycloakTransactionManager method begin.
@Override
public void begin() {
if (active) {
throw new IllegalStateException("Transaction already active");
}
completed = false;
if (jtaPolicy == JTAPolicy.REQUIRES_NEW) {
JtaTransactionManagerLookup jtaLookup = session.getProvider(JtaTransactionManagerLookup.class);
if (jtaLookup != null) {
TransactionManager tm = jtaLookup.getTransactionManager();
if (tm != null) {
enlist(new JtaTransactionWrapper(session.getKeycloakSessionFactory(), tm));
}
}
}
for (KeycloakTransaction tx : transactions) {
tx.begin();
}
active = true;
}
Aggregations