mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-04 16:59:29 +00:00
HHH-13916 : Add a unique Session "token"
This commit is contained in:
parent
7bca059f94
commit
903bb292e7
@ -118,6 +118,15 @@ default SharedSessionContractImplementor getSession() {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A "token" that is unique to this Session.
|
||||||
|
*
|
||||||
|
* @return The token
|
||||||
|
*/
|
||||||
|
default Object getSessionToken() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the session is closed. Provided separately from
|
* Checks whether the session is closed. Provided separately from
|
||||||
* {@link #isOpen()} as this method does not attempt any JTA synchronization
|
* {@link #isOpen()} as this method does not attempt any JTA synchronization
|
||||||
|
@ -105,6 +105,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont
|
|||||||
private final String tenantIdentifier;
|
private final String tenantIdentifier;
|
||||||
protected transient FastSessionServices fastSessionServices;
|
protected transient FastSessionServices fastSessionServices;
|
||||||
private UUID sessionIdentifier;
|
private UUID sessionIdentifier;
|
||||||
|
private Object sessionToken;
|
||||||
|
|
||||||
private transient JdbcConnectionAccess jdbcConnectionAccess;
|
private transient JdbcConnectionAccess jdbcConnectionAccess;
|
||||||
private transient JdbcSessionContext jdbcSessionContext;
|
private transient JdbcSessionContext jdbcSessionContext;
|
||||||
@ -277,6 +278,14 @@ public UUID getSessionIdentifier() {
|
|||||||
return sessionIdentifier;
|
return sessionIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getSessionToken() {
|
||||||
|
if ( sessionToken == null ) {
|
||||||
|
sessionToken = new Object();
|
||||||
|
}
|
||||||
|
return sessionToken;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTenantIdentifier() {
|
public String getTenantIdentifier() {
|
||||||
return tenantIdentifier;
|
return tenantIdentifier;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user