Package org.keycloak.utils
Class LockObjectsForModification
java.lang.Object
org.keycloak.utils.LockObjectsForModification
This flags the session that all information loaded from the stores should be locked as the service layer
plans to modify it.
This is just a hint to the underlying storage, and a store might choose to ignore it.
The lock for any object retrieved from the session will be kept until the end of the transaction.
If the store supports it, this could prevent exceptions due to optimistic locking
problems later in the processing. If the caller retrieved objects without this wrapper, they would still be
able to modify those objects, and those changes would be written to the store at the end of the transaction at the lastet,
but they won't be locked.
- Author:
- Alexander Schwartz
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isEnabled
(KeycloakSession session, Class<?> model) static <V> V
lockRealmsForModification
(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable) static <V> V
lockUserSessionsForModification
(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable)
-
Constructor Details
-
LockObjectsForModification
public LockObjectsForModification()
-
-
Method Details
-
isEnabled
-
lockUserSessionsForModification
public static <V> V lockUserSessionsForModification(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable) -
lockRealmsForModification
public static <V> V lockRealmsForModification(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable)
-