int fetches = ( int ) getSessions().getStatistics().getEntityFetchCount();
assertEquals( count, fetches );
}
protected Session applyNonFlushedChangesToNewSessionCloseOldSession(Session oldSession) {
NonFlushedChanges nfc = ( ( SessionImplementor ) oldSession ).getNonFlushedChanges();
byte[] bytes = SerializationHelper.serialize( nfc );
NonFlushedChanges nfc2 = ( NonFlushedChanges ) SerializationHelper.deserialize( bytes );
Session newSession = openSession();
( ( SessionImplementor ) newSession ).applyNonFlushedChanges( nfc2 );
oldToNewEntityRefs.clear();
for ( Iterator it = ( ( SessionImplementor ) oldSession ).getPersistenceContext()
.getEntitiesByKey()