mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 12:14:47 +00:00
HHH-11076 Log a warning if uninitialized collection unsets session when filters are enabled
This commit is contained in:
parent
c1a7a14d1c
commit
72bcd97db8
@ -656,6 +656,10 @@ public final boolean unsetSession(SharedSessionContractImplementor currentSessio
|
||||
LOG.queuedOperationWhenDetachFromSession( collectionInfoString );
|
||||
}
|
||||
}
|
||||
if ( allowLoadOutsideTransaction && !initialized && session.getLoadQueryInfluencers().hasEnabledFilters() ) {
|
||||
final String collectionInfoString = MessageHelper.collectionInfoString( getRole(), getKey() );
|
||||
LOG.enabledFiltersWhenDetachFromSession( collectionInfoString );
|
||||
}
|
||||
this.session = null;
|
||||
}
|
||||
return true;
|
||||
|
@ -1856,4 +1856,8 @@ void attemptToAssociateProxyWithTwoOpenSessions(
|
||||
@Message(value = "Ignoring ServiceConfigurationError caught while trying to instantiate service '%s'.", id = 505)
|
||||
void ignoringServiceConfigurationError(Class<?> serviceContract, @Cause ServiceConfigurationError error);
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
@Message(value = "Detaching an uninitialized collection with enabled filters from a session: %s", id = 506)
|
||||
void enabledFiltersWhenDetachFromSession(String collectionInfoString);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user