HHH-11076 Log a warning if uninitialized collection unsets session when filters are enabled
This commit is contained in:
parent
eb639a2d95
commit
1714c022e2
|
@ -656,6 +656,10 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
|
||||||
LOG.queuedOperationWhenDetachFromSession( collectionInfoString );
|
LOG.queuedOperationWhenDetachFromSession( collectionInfoString );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( allowLoadOutsideTransaction && !initialized && session.getLoadQueryInfluencers().hasEnabledFilters() ) {
|
||||||
|
final String collectionInfoString = MessageHelper.collectionInfoString( getRole(), getKey() );
|
||||||
|
LOG.enabledFiltersWhenDetachFromSession( collectionInfoString );
|
||||||
|
}
|
||||||
this.session = null;
|
this.session = null;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1856,4 +1856,8 @@ public interface CoreMessageLogger extends BasicLogger {
|
||||||
@Message(value = "Ignoring ServiceConfigurationError caught while trying to instantiate service '%s'.", id = 505)
|
@Message(value = "Ignoring ServiceConfigurationError caught while trying to instantiate service '%s'.", id = 505)
|
||||||
void ignoringServiceConfigurationError(Class<?> serviceContract, @Cause ServiceConfigurationError error);
|
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…
Reference in New Issue