Code example for EventSource

Methods: getPersistenceContext

0
	} 
	public void evictCollection(Object value, CollectionType type) { 
 
		final Object pc; 
		if ( type.hasHolder() ) { 
			pc = getSession().getPersistenceContext().removeCollectionHolder(value); 
		} 
		else if ( value instanceof PersistentCollection ) { 
			pc = value; 
		} 
		else { 
			return; //EARLY EXIT! 
		} 
 
		PersistentCollection collection = (PersistentCollection) pc; 
		if ( collection.unsetSession( getSession() ) ) evictCollection(collection); 
	} 
 
	private void evictCollection(PersistentCollection collection) { 
		CollectionEntry ce = (CollectionEntry) getSession().getPersistenceContext().getCollectionEntries().remove(collection); 
        if (LOG.isDebugEnabled()) LOG.debugf("Evicting collection: %s", 
                                             MessageHelper.collectionInfoString(ce.getLoadedPersister(), 
                                                                                ce.getLoadedKey(), 
                                                                                getSession().getFactory())); 
		if ( ce.getLoadedPersister() != null && ce.getLoadedKey() != null ) {