Type: New Feature
Affects Version/s: None
Fix Version/s: None
Last commented by a user?:true
CurrentSessionContext implementations cache sessions, per context (thread, managed, JTA). They also check that the session returned is using the right tenant id (according to CurrentTenantIdentifierResolver. An exception is raised other wise.
A user proposed the following adjustments:
CurrentSessionContext implementations will cache sessions per tenant id and per context. For a given context, say the same thread, we would receive different sessions if CurrentTenantIdentifierResolver returns different tenant ids between the calls to Session.currentSession().
The use case is as followed. Some part of the application needs to access the data from more than one tenant (some admin or dashboard). In this case, it might be necessary to have different sessions for each tenant id requested within the same context.
Steve Ebersole do you think that's a reasonable change?
The context is here https://forum.hibernate.org/viewtopic.php?f=1&t=1035802