/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) { LOG.debug( "Session dirty" ); } else { LOG.debug( "Session not dirty" ); } event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
private void replaceActionQueue(ActionQueue actionQueueNew) { if ( actionQueue.hasAnyQueuedActions() ) { throw new IllegalStateException( "cannot replace an ActionQueue with queued actions " ); } actionQueue.clear(); ObjectInputStream ois = null; try { ois = new ObjectInputStream( new ByteArrayInputStream( serializeActionQueue( actionQueueNew ) ) ); actionQueue = ActionQueue.deserialize( ois, this ); } catch (IOException ex) { throw new SerializationException( "could not deserialize the action queue", ex ); } catch (ClassNotFoundException ex) { throw new SerializationException( "could not deserialize the action queue", ex ); } finally { try { if (ois != null) ois.close(); } catch (IOException ignore) { } } }
private void replaceActionQueue(ActionQueue actionQueueNew) { if ( actionQueue.hasAnyQueuedActions() ) { throw new IllegalStateException( "cannot replace an ActionQueue with queued actions " ); } actionQueue.clear(); ObjectInputStream ois = null; try { ois = new ObjectInputStream( new ByteArrayInputStream( serializeActionQueue( actionQueueNew ) ) ); actionQueue = ActionQueue.deserialize( ois, this ); } catch (IOException ex) { throw new SerializationException( "could not deserialize the action queue", ex ); } catch (ClassNotFoundException ex) { throw new SerializationException( "could not deserialize the action queue", ex ); } finally { try { if (ois != null) ois.close(); } catch (IOException ignore) { } } }
/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) LOG.debug( "Session dirty" ); else LOG.debug( "Session not dirty" ); event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) LOG.debug( "Session dirty" ); else LOG.debug( "Session not dirty" ); event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) { LOG.debug( "Session dirty" ); } else { LOG.debug( "Session not dirty" ); } event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }