HHH-7974 - Session.getTenantIdentifier() not callable without active transaction

(cherry picked from commit d9aa9d3cd2)
This commit is contained in:
Steve Ebersole 2013-04-15 11:21:02 -05:00
parent 772f3cbc5d
commit 812d3f6bf0
1 changed files with 8 additions and 8 deletions

View File

@ -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
} }
@ -333,15 +333,15 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
else if ( !realSession.getTransaction().isActive() ) { else if ( !realSession.getTransaction().isActive() ) {
// limit the methods available if no transaction is active // limit the methods available if no transaction is active
if ( "beginTransaction".equals( methodName ) if ( "beginTransaction".equals( methodName )
|| "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 {