allow override of begin transaction

Closes #31005

Signed-off-by: Baljit Singh <baljit.singh@verizon.com>
This commit is contained in:
Baljit Singh 2024-07-01 18:48:56 -04:00 committed by Alexander Schwartz
parent 2da37542e8
commit 94934d1ad4

View file

@ -17,8 +17,6 @@
package org.keycloak.models; package org.keycloak.models;
import org.jboss.logging.Logger;
/** /**
* Handles some common transaction logic related to start, rollback-only etc. * Handles some common transaction logic related to start, rollback-only etc.
* *
@ -34,6 +32,8 @@ public abstract class AbstractKeycloakTransaction implements KeycloakTransaction
throw new IllegalStateException("Transaction already started"); throw new IllegalStateException("Transaction already started");
} }
beginImpl();
state = TransactionState.STARTED; state = TransactionState.STARTED;
} }
@ -82,6 +82,7 @@ public abstract class AbstractKeycloakTransaction implements KeycloakTransaction
NOT_STARTED, STARTED, ROLLBACK_ONLY, FINISHED NOT_STARTED, STARTED, ROLLBACK_ONLY, FINISHED
} }
protected void beginImpl() {}
protected abstract void commitImpl(); protected abstract void commitImpl();