Package org.hibernate.engine
Class ActionQueue
java.lang.Object
org.hibernate.engine.ActionQueue
Responsible for maintaining the queue of actions related to events.
The ActionQueue holds the DML operations queued as part of a session's
transactional-write-behind semantics. DML operations are queued here
until a flush forces them to be executed against the database.
-
Constructor Summary
ConstructorsConstructorDescriptionActionQueue(SessionImplementor session) Constructs an action queue bound to the given session. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAction(BulkOperationCleanupAction cleanupAction) voidaddAction(CollectionRecreateAction action) voidaddAction(CollectionRemoveAction action) voidaddAction(CollectionUpdateAction action) voidaddAction(EntityDeleteAction action) voidaddAction(EntityIdentityInsertAction insert) voidaddAction(EntityInsertAction action) voidaddAction(EntityUpdateAction action) voidafterTransactionCompletion(boolean success) Performs cleanup of any held cache softlocks.booleanCheck whether any insertion or deletion actions are currently queued.booleanareTablesToBeUpdated(Set tables) Check whether the given tables/query-spaces are to be executed against given the currently queued actions.voidExecute any registeredBeforeTransactionCompletionProcessvoidclear()voidclearFromFlushNeededCheck(int previousCollectionRemovalSize) static ActionQueuedeserialize(ObjectInputStream ois, SessionImplementor session) Used by the owning session to explicitly control deserialization of the action queuevoidexecute(Executable executable) voidPerform all currently queued actions.voidPerform all currently queued entity-insertion actions.booleanbooleanbooleanintintintintintintvoidPrepares the internal action queues for execution.voidvoidvoidUsed by the owning session to explicitly control serialization of the action queuevoidvoidtoString()Returns a string representation of the object.voidunScheduleDeletion(EntityEntry entry, Object rescuedEntity)
-
Constructor Details
-
ActionQueue
Constructs an action queue bound to the given session.- Parameters:
session- The session "owning" this queue.
-
-
Method Details
-
clear
public void clear() -
addAction
-
addAction
-
addAction
-
addAction
-
addAction
-
addAction
-
addAction
-
addAction
-
registerProcess
-
registerProcess
-
executeInserts
Perform all currently queued entity-insertion actions.- Throws:
HibernateException- error executing queued insertion actions.
-
executeActions
Perform all currently queued actions.- Throws:
HibernateException- error executing queued actions.
-
prepareActions
Prepares the internal action queues for execution.- Throws:
HibernateException- error preparing actions.
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean success) Performs cleanup of any held cache softlocks.- Parameters:
success- Was the transaction successful.
-
beforeTransactionCompletion
public void beforeTransactionCompletion()Execute any registeredBeforeTransactionCompletionProcess -
areTablesToBeUpdated
Check whether the given tables/query-spaces are to be executed against given the currently queued actions.- Parameters:
tables- The table/query-spaces to check.- Returns:
- True if we contain pending actions against any of the given tables; false otherwise.
-
areInsertionsOrDeletionsQueued
public boolean areInsertionsOrDeletionsQueued()Check whether any insertion or deletion actions are currently queued.- Returns:
- True if insertions or deletions are currently queued; false otherwise.
-
execute
-
toString
Returns a string representation of the object. -
numberOfCollectionRemovals
public int numberOfCollectionRemovals() -
numberOfCollectionUpdates
public int numberOfCollectionUpdates() -
numberOfCollectionCreations
public int numberOfCollectionCreations() -
numberOfDeletions
public int numberOfDeletions() -
numberOfUpdates
public int numberOfUpdates() -
numberOfInsertions
public int numberOfInsertions() -
sortCollectionActions
public void sortCollectionActions() -
sortActions
public void sortActions() -
cloneDeletions
-
clearFromFlushNeededCheck
public void clearFromFlushNeededCheck(int previousCollectionRemovalSize) -
hasAfterTransactionActions
public boolean hasAfterTransactionActions() -
hasBeforeTransactionActions
public boolean hasBeforeTransactionActions() -
hasAnyQueuedActions
public boolean hasAnyQueuedActions() -
unScheduleDeletion
-
serialize
Used by the owning session to explicitly control serialization of the action queue- Parameters:
oos- The stream to which the action queue should get written- Throws:
IOException- Indicates an error writing to the stream
-
deserialize
public static ActionQueue deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException Used by the owning session to explicitly control deserialization of the action queue- Parameters:
ois- The stream from which to read the action queuesession- The session to which the action queue belongs- Returns:
- The deserialized action queue
- Throws:
IOException- indicates a problem reading from the streamClassNotFoundException- Generally means we were unable to locate user classes.
-