currentSession().setFlushMode( filter.previousFlushMode );
    private void afterUpdate( Object argument, UpdateFilter filter)    {                if ( logger.isDebugEnabled() )            logger.debug( " Post-save cleanup. " );                // Save all that and go back to AUTO flush.        getHibernateTemplate().flush(); // TODO performance?        currentSession().setFlushMode(FlushMode.AUTO);                // Let's save the event again using a temporary event.        Event currentEvent = CurrentDetails.getCreationEvent();        EventType internal = (EventType) getHibernateTemplate().execute(                new HibernateCallback(){                    public Object doInHibernate(Session session)                     throws HibernateException, SQLException                    {                        Criteria c = session.createCriteria(EventType.class)                        .add( Restrictions.like( "value", "Internal" ));                        return c.uniqueResult();                    }                }                );        CurrentDetails.newEvent( internal );        internalSave( currentEvent, filter );        // Checks.        List logs = CurrentDetails.getCreationEvent().collectLogs( null );        if (logs.size() > 0)            log.error("New logs created on update.afterSave:\n"+logs);        // FIXME we shouldn't be updating experimenter etc. here.                // Return the previous event.        CurrentDetails.setCreationEvent( currentEvent );                // Clean up        filter.unloadReplacedObjects();            }