private void doFlush() { checkTransactionNeeded(); checkTransactionSynchStatus(); try { if ( persistenceContext.getCascadeLevel() > 0 ) { throw new HibernateException( "Flush during cascade is dangerous" ); } FlushEvent flushEvent = new FlushEvent( this ); for ( FlushEventListener listener : listeners( EventType.FLUSH ) ) { listener.onFlush( flushEvent ); } delayedAfterCompletion(); } catch ( RuntimeException e ) { throw exceptionConverter.convert( e ); } }
public void flush() throws HibernateException { errorIfClosed(); checkTransactionSynchStatus(); if ( persistenceContext.getCascadeLevel() > 0 ) { throw new HibernateException("Flush during cascade is dangerous"); } FlushEvent flushEvent = new FlushEvent( this ); for ( FlushEventListener listener : listeners( EventType.FLUSH ) ) { listener.onFlush( flushEvent ); } }
public void flush() throws HibernateException { errorIfClosed(); checkTransactionSynchStatus(); if ( persistenceContext.getCascadeLevel() > 0 ) { throw new HibernateException("Flush during cascade is dangerous"); } FlushEvent flushEvent = new FlushEvent( this ); for ( FlushEventListener listener : listeners( EventType.FLUSH ) ) { listener.onFlush( flushEvent ); } }
private void doFlush() { checkTransactionNeeded(); checkTransactionSynchStatus(); try { if ( persistenceContext.getCascadeLevel() > 0 ) { throw new HibernateException( "Flush during cascade is dangerous" ); } FlushEvent flushEvent = new FlushEvent( this ); for ( FlushEventListener listener : listeners( EventType.FLUSH ) ) { listener.onFlush( flushEvent ); } delayedAfterCompletion(); } catch ( RuntimeException e ) { throw exceptionConverter.convert( e ); } }
/** * Force the session to flush, but don't throw an exception if performed outside of a transaction. * * @param session the Session object * @throws org.hibernate.HibernateException Indicates problems flushing the session or talking to the database */ public static void flushAllowNoTransaction(final Session session) throws HibernateException { SessionImplementor sessionImplementor = (SessionImplementor) session; errorIfClosed(sessionImplementor); try { if (sessionImplementor.getPersistenceContext().getCascadeLevel() > 0) { throw new HibernateException("Flush during cascade is dangerous"); } FlushEvent flushEvent = new FlushEvent((EventSource) sessionImplementor); for (final FlushEventListener listener : eventListenerGroup(session, EventType.FLUSH).listeners()) { listener.onFlush(flushEvent); } } catch (RuntimeException e) { throw sessionImplementor.getExceptionConverter().convert(e); } }