HHH-12835 In the end, remove the assertion

It's not really compatible with batch loading, padding and a couple of
other corner cases.

And I don't think it has a lot of value by itself.
This commit is contained in:
Guillaume Smet 2018-08-01 16:07:49 +02:00
parent 725da274fd
commit 349bd2649c
1 changed files with 0 additions and 2 deletions

View File

@ -54,12 +54,10 @@ public class BatchFetchQueueHelper {
} }
LOG.debug( "Not all entities were loaded." ); LOG.debug( "Not all entities were loaded." );
Set<Serializable> idSet = new HashSet<>( Arrays.asList( ids ) ); Set<Serializable> idSet = new HashSet<>( Arrays.asList( ids ) );
int originalIdSetSize = idSet.size();
for ( Object result : results ) { for ( Object result : results ) {
// All results should be in the PersistenceContext // All results should be in the PersistenceContext
idSet.remove( session.getContextEntityIdentifier( result ) ); idSet.remove( session.getContextEntityIdentifier( result ) );
} }
assert idSet.size() == originalIdSetSize - results.size();
if ( LOG.isDebugEnabled() ) { if ( LOG.isDebugEnabled() ) {
LOG.debug( "Entities of type [" + persister.getEntityName() + "] not found; IDs: " + idSet ); LOG.debug( "Entities of type [" + persister.getEntityName() + "] not found; IDs: " + idSet );
} }