/// <summary> /// Updates the CollectionEntry to reflect that it is has been successfully flushed to the database. /// </summary> /// <param name="collection">The <see cref="PersistentCollection"/> that was flushed.</param> /// <remarks> /// Called after a <em>successful</em> flush. /// </remarks> internal bool PostFlush( PersistentCollection collection ) { if( ignore ) { ignore = false; } else { // the CollectionEntry should be processed if we are in the PostFlush() if( !processed ) { throw new AssertionFailure( "collection was not processed by Flush()" ); } // now that the flush has gone through move everything that is the current // over to the loaded fields and set dirty to false since the db & collection // are in synch. loadedKey = currentKey; SetLoadedPersister( currentPersister ); dirty = false; // collection needs to know its' representation in memory and with // the db is now in synch - esp important for collections like a bag // that can add without initializing the collection. collection.PostFlush(); // if it was initialized or any of the scheduled actions were performed then // need to resnapshot the contents of the collection. if( initialized && ( doremove || dorecreate || doupdate ) ) { InitSnapshot( collection, loadedPersister ); } } return loadedPersister == null; }