HHH-7974 - Session.getTenantIdentifier() not callable without active transaction
(cherry picked from commit d9aa9d3cd2
)
This commit is contained in:
parent
772f3cbc5d
commit
812d3f6bf0
|
@ -319,7 +319,7 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
|
||||||
|| "hashCode".equals( methodName )
|
|| "hashCode".equals( methodName )
|
||||||
|| "getStatistics".equals( methodName )
|
|| "getStatistics".equals( methodName )
|
||||||
|| "isOpen".equals( methodName )
|
|| "isOpen".equals( methodName )
|
||||||
|| "getListeners".equals( methodName ) //useful for HSearch in particular
|
|| "getListeners".equals( methodName )
|
||||||
) {
|
) {
|
||||||
// allow these to go through the the real session no matter what
|
// allow these to go through the the real session no matter what
|
||||||
}
|
}
|
||||||
|
@ -336,12 +336,12 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
|
||||||
|| "getTransaction".equals( methodName )
|
|| "getTransaction".equals( methodName )
|
||||||
|| "isTransactionInProgress".equals( methodName )
|
|| "isTransactionInProgress".equals( methodName )
|
||||||
|| "setFlushMode".equals( methodName )
|
|| "setFlushMode".equals( methodName )
|
||||||
|| "getFactory".equals( methodName ) //from SessionImplementor
|
|| "getFactory".equals( methodName )
|
||||||
|| "getSessionFactory".equals( methodName ) ) {
|
|| "getSessionFactory".equals( methodName )
|
||||||
|
|| "getTenantIdentifier".equals( methodName ) ) {
|
||||||
LOG.tracev( "Allowing method [{0}] in non-transacted context", methodName );
|
LOG.tracev( "Allowing method [{0}] in non-transacted context", methodName );
|
||||||
}
|
}
|
||||||
else if ( "reconnect".equals( methodName )
|
else if ( "reconnect".equals( methodName ) || "disconnect".equals( methodName ) ) {
|
||||||
|| "disconnect".equals( methodName ) ) {
|
|
||||||
// allow these (deprecated) methods to pass through
|
// allow these (deprecated) methods to pass through
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue