@Override public T interceptor() { return interceptor( session.getInterceptor() ); }
@Override public void afterTransactionBegin() { checkOpenOrWaitingForAutoClose(); getInterceptor().afterTransactionBegin( getCurrentTransaction() ); }
@Override public void beforeCompletion() { if ( isOpen() && getHibernateFlushMode() != FlushMode.MANUAL ) { managedFlush(); } actionQueue.beforeTransactionCompletion(); try { getInterceptor().beforeTransactionCompletion( getCurrentTransaction() ); } catch (Throwable t) { log.exceptionInBeforeTransactionCompletionInterceptor( t ); } }
@Override public void beforeTransactionCompletion() { log.tracef( "SessionImpl#beforeTransactionCompletion()" ); flushBeforeTransactionCompletion(); actionQueue.beforeTransactionCompletion(); try { getInterceptor().beforeTransactionCompletion( getCurrentTransaction() ); } catch (Throwable t) { log.exceptionInBeforeTransactionCompletionInterceptor( t ); } super.beforeTransactionCompletion(); }
@Override public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException { checkOpenOrWaitingForAutoClose(); // todo : should this get moved to PersistentContext? // logically, is PersistentContext the "thing" to which an interceptor gets attached? final Object result = persistenceContext.getEntity( key ); if ( result == null ) { final Object newObject = getInterceptor().getEntity( key.getEntityName(), key.getIdentifier() ); if ( newObject != null ) { lock( newObject, LockMode.NONE ); } return newObject; } else { return result; } }
/** * give the interceptor an opportunity to override the default instantiation */ @Override public Object instantiate(EntityPersister persister, Serializable id) throws HibernateException { checkOpenOrWaitingForAutoClose(); checkTransactionSynchStatus(); Object result = getInterceptor().instantiate( persister.getEntityName(), persister.getEntityMetamodel().getEntityMode(), id ); if ( result == null ) { result = persister.instantiate( id, this ); } delayedAfterCompletion(); return result; }
@Override public void afterTransactionCompletion(boolean successful, boolean delayed) { log.tracef( "SessionImpl#afterTransactionCompletion(successful=%s, delayed=%s)", successful, delayed ); if ( !isClosed() || waitingForAutoClose ) { if ( autoClear ||!successful ) { internalClear(); } } persistenceContext.afterTransactionCompletion(); actionQueue.afterTransactionCompletion( successful ); getEventListenerManager().transactionCompletion( successful ); if ( getFactory().getStatistics().isStatisticsEnabled() ) { getFactory().getStatistics().endTransaction( successful ); } try { getInterceptor().afterTransactionCompletion( getCurrentTransaction() ); } catch (Throwable t) { log.exceptionInAfterTransactionCompletionInterceptor( t ); } if ( !delayed ) { if ( shouldAutoClose() && (!isClosed() || waitingForAutoClose) ) { managedClose(); } } super.afterTransactionCompletion( successful, delayed ); }
@Override public T interceptor() { return interceptor( session.getInterceptor() ); }
@Override public void afterTransactionBegin() { checkOpenOrWaitingForAutoClose(); getInterceptor().afterTransactionBegin( getCurrentTransaction() ); }
@Override public void beforeCompletion() { if ( isOpen() && getHibernateFlushMode() != FlushMode.MANUAL ) { managedFlush(); } actionQueue.beforeTransactionCompletion(); try { getInterceptor().beforeTransactionCompletion( getCurrentTransaction() ); } catch (Throwable t) { log.exceptionInBeforeTransactionCompletionInterceptor( t ); } }
@Override public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException { checkOpenOrWaitingForAutoClose(); // todo : should this get moved to PersistentContext? // logically, is PersistentContext the "thing" to which an interceptor gets attached? final Object result = persistenceContext.getEntity( key ); if ( result == null ) { final Object newObject = getInterceptor().getEntity( key.getEntityName(), key.getIdentifier() ); if ( newObject != null ) { lock( newObject, LockMode.NONE ); } return newObject; } else { return result; } }
@Override public void beforeTransactionCompletion() { log.tracef( "SessionImpl#beforeTransactionCompletion()" ); flushBeforeTransactionCompletion(); actionQueue.beforeTransactionCompletion(); try { getInterceptor().beforeTransactionCompletion( getCurrentTransaction() ); } catch (Throwable t) { log.exceptionInBeforeTransactionCompletionInterceptor( t ); } super.beforeTransactionCompletion(); }
/** * give the interceptor an opportunity to override the default instantiation */ @Override public Object instantiate(EntityTypeDescriptor entityDescriptor, Object id) throws HibernateException { checkOpenOrWaitingForAutoClose(); checkTransactionSynchStatus(); Object result = getInterceptor().instantiate( entityDescriptor.getEntityName(), entityDescriptor.getRepresentationStrategy().getMode(), id ); if ( result == null ) { result = entityDescriptor.instantiate( id, this ); } delayedAfterCompletion(); return result; }
@Override public void afterTransactionCompletion(boolean successful, boolean delayed) { log.tracef( "SessionImpl#afterTransactionCompletion(successful=%s, delayed=%s)", successful, delayed ); if ( !isClosed() || waitingForAutoClose ) { if ( autoClear ||!successful ) { internalClear(); } } persistenceContext.afterTransactionCompletion(); actionQueue.afterTransactionCompletion( successful ); getEventListenerManager().transactionCompletion( successful ); if ( getFactory().getStatistics().isStatisticsEnabled() ) { getFactory().getStatistics().endTransaction( successful ); } try { getInterceptor().afterTransactionCompletion( getCurrentTransaction() ); } catch (Throwable t) { log.exceptionInAfterTransactionCompletionInterceptor( t ); } if ( !delayed ) { if ( shouldAutoClose() && (!isClosed() || waitingForAutoClose) ) { managedClose(); } } super.afterTransactionCompletion( successful, delayed ); }