@groovy.transform.CompileStatic class TransactionSynchronizationSessionResolver extends java.lang.Object implements SessionResolver
The default SessionResolver, backed by the same SessionHolder/ TransactionSynchronizationManager state as DatastoreUtils's session binding - a thin, stateless view over the one authoritative session stack for its owning datastore, rather than an independent thread-local store that could disagree with it. Nested bindings are supported because SessionHolder itself is a stack: bind(Session) pushes, resolve() returns the topmost still-connected session, and unbind() closes and pops only the top session, restoring the outer binding rather than discarding the whole holder.
resolve() performs the same housekeeping as DatastoreUtils.doGetSession:
disconnected sessions are evicted from the holder, and a holder left empty by eviction is
unbound (unless it is synchronized with an active transaction, in which case the transaction
manager owns its lifecycle) so that a stale binding can never block a later
bindSession.
| Constructor and description |
|---|
TransactionSynchronizationSessionResolver(Datastore datastore) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |