Replies: 1 comment
-
Hi @vramik - thanks for starting this discussion. Here some thoughts, some are not answers, yet:
You have been asking about Looking at the Regarding the AuthSession implementations: Let me recap what I know about the relation of I'd may even go so far to advocate for pessimistically locking the root session to make a concurrent interaction in another tab wait for the other tab to complete. When doing this, I'd be a bit hesitant, as we're also locking user sessions already. If there are different areas of the code that lock those two objects pessimistically in a different order, this could lead to deadlocks. Keeping the optimistic locking would lead to optimistic locking exceptions. So let's be cautious here. |
Beta Was this translation helpful? Give feedback.
-
There are few interfaces in jpa map store
JpaRootEntity
- interface should represent an entity with jsonb colunm. There are methods for getting and updating entityVersion. Also method for obtaining currentSchemaVersionJpaRootVersionedEntity
- extendsJpaRootEntity
and adds optimistic locking feature for the entityJpaChildEntity
- should represent child entity (hasR getParent()
method) and also serves in bothJpaOptimisticLockingListener
andJpaEntityVersionListener
.With implementation of user jpa store there has been added few entities which somewhat collides in terms of above.
JpaUserConsentEntity
,JpaUserFederatedIdentityEntity
implementsJpaChildEntity
(so it affects locking of its parent entityJpaUserEntity
withinJpaOptimisticLockingListener
) and also contains jsonb column (which is not taken into an account whenJpaEntityVersionListener
tries to update the entity version).Also with auth session implementation:
JpaAuthenticationSessionEntity
is technically child entity ofJpaRootAuthenticationSessionEntity
but doesn't implementJpaChildEntity
, so nothing happens withinJpaOptimisticLockingListener
.Any thouths?
Should we e.g. create new interface for entities with jsonb column and leave parent-child relationship as is? Or can we mark some entities as both parent and child?
Beta Was this translation helpful? Give feedback.
All reactions