@Override public void initializeCollection(PersistentCollection collection, boolean writing) { checkOpenOrWaitingForAutoClose(); checkTransactionSynchStatus(); InitializeCollectionEvent event = new InitializeCollectionEvent( collection, this ); for ( InitializeCollectionEventListener listener : listeners( EventType.INIT_COLLECTION ) ) { listener.onInitializeCollection( event ); } delayedAfterCompletion(); }
public InitializeCollectionEvent(PersistentCollection collection, EventSource source ) { super( getLoadedCollectionPersister( collection, source ), collection, source, getLoadedOwnerOrNull( collection, source ), getLoadedOwnerIdOrNull( collection, source ) ); } }
PersistentCollection collection = event.getCollection(); SessionImplementor source = event.getSession();
public InitializeCollectionEvent(PersistentCollection collection, EventSource source) { super( getLoadedCollectionDescriptor( collection, source ), collection, source, getLoadedOwnerOrNull( collection, source ), getLoadedOwnerIdOrNull( collection, source ) ); } }
EventListenerRegistry registry = ((SessionFactoryImpl)sessionFactory).getServiceRegistry().getService(EventListenerRegistry.class); registry.appendListeners(EventType.INIT_COLLECTION, new InitializeCollectionEventListener()); public class InitializeCollectionEventListener implements InitializeCollectionEventListener{ DefaultInitializeCollectionEventListener defaultListener; InitializeCollectionEventListener(){ defaultListener = new DefaultInitializeCollectionEventListener(); } public void onInitializeCollection(InitializeCollectionEvent pEvent) throws HibernateException { defaultListener.onInitializeCollection(pEvent); SessionImpl si = (SessionImpl) pEvent.getSession(); if (!si.isTransactionInProgress() && !si.isClosed() && si.isConnected() && si.getConnectionReleaseMode().equals(ConnectionReleaseMode.AFTER_TRANSACTION)){ si.getTransactionCoordinator().getJdbcCoordinator().getLogicalConnection().aggressiveRelease(); } } }
throws HibernateException { PersistentCollection collection = event.getCollection(); SessionImplementor source = event.getSession();
public InitializeCollectionEvent(PersistentCollection collection, EventSource source ) { super( getLoadedCollectionPersister( collection, source ), collection, source, getLoadedOwnerOrNull( collection, source ), getLoadedOwnerIdOrNull( collection, source ) ); } }
throws HibernateException { PersistentCollection collection = event.getCollection(); SessionImplementor source = event.getSession();
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException { errorIfClosed(); checkTransactionSynchStatus(); InitializeCollectionEvent event = new InitializeCollectionEvent( collection, this ); for ( InitializeCollectionEventListener listener : listeners( EventType.INIT_COLLECTION ) ) { listener.onInitializeCollection( event ); } }
public InitializeCollectionEvent(PersistentCollection collection, EventSource source ) { super( getLoadedCollectionPersister( collection, source ), collection, source, getLoadedOwnerOrNull( collection, source ), getLoadedOwnerIdOrNull( collection, source ) ); } }
PersistentCollection collection = event.getCollection(); SessionImplementor source = event.getSession();
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException { errorIfClosed(); checkTransactionSynchStatus(); InitializeCollectionEvent event = new InitializeCollectionEvent( collection, this ); for ( InitializeCollectionEventListener listener : listeners( EventType.INIT_COLLECTION ) ) { listener.onInitializeCollection( event ); } }
@Override public void initializeCollection(PersistentCollection collection, boolean writing) { checkOpenOrWaitingForAutoClose(); checkTransactionSynchStatus(); InitializeCollectionEvent event = new InitializeCollectionEvent( collection, this ); for ( InitializeCollectionEventListener listener : listeners( EventType.INIT_COLLECTION ) ) { listener.onInitializeCollection( event ); } delayedAfterCompletion(); }