public class

ActionQueue

extends Object
java.lang.Object
   ↳ org.hibernate.engine.ActionQueue

Class Overview

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.

Summary

Public Constructors
ActionQueue(SessionImplementor session)
Constructs an action queue bound to the given session.
Public Methods
void addAction(CollectionRecreateAction action)
void addAction(CollectionUpdateAction action)
void addAction(EntityDeleteAction action)
void addAction(BulkOperationCleanupAction cleanupAction)
void addAction(CollectionRemoveAction action)
void addAction(EntityUpdateAction action)
void addAction(EntityIdentityInsertAction insert)
void addAction(EntityInsertAction action)
void afterTransactionCompletion(boolean success)
Performs cleanup of any held cache softlocks.
boolean areInsertionsOrDeletionsQueued()
Check whether any insertion or deletion actions are currently queued.
boolean areTablesToBeUpdated(Set tables)
Check whether the given tables/query-spaces are to be executed against given the currently queued actions.
void beforeTransactionCompletion()
Execute any registered BeforeTransactionCompletionProcess
void clear()
void clearFromFlushNeededCheck(int previousCollectionRemovalSize)
ArrayList cloneDeletions()
static ActionQueue deserialize(ObjectInputStream ois, SessionImplementor session)
Used by the owning session to explicitly control deserialization of the action queue
void execute(Executable executable)
void executeActions()
Perform all currently queued actions.
void executeInserts()
Perform all currently queued entity-insertion actions.
boolean hasAfterTransactionActions()
boolean hasAnyQueuedActions()
boolean hasBeforeTransactionActions()
int numberOfCollectionCreations()
int numberOfCollectionRemovals()
int numberOfCollectionUpdates()
int numberOfDeletions()
int numberOfInsertions()
int numberOfUpdates()
void prepareActions()
Prepares the internal action queues for execution.
void registerProcess(AfterTransactionCompletionProcess process)
void registerProcess(BeforeTransactionCompletionProcess process)
void serialize(ObjectOutputStream oos)
Used by the owning session to explicitly control serialization of the action queue
void sortActions()
void sortCollectionActions()
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ActionQueue (SessionImplementor session)

Constructs an action queue bound to the given session.

Parameters
session The session "owning" this queue.

Public Methods

public void addAction (CollectionRecreateAction action)

public void addAction (CollectionUpdateAction action)

public void addAction (EntityDeleteAction action)

public void addAction (BulkOperationCleanupAction cleanupAction)

public void addAction (CollectionRemoveAction action)

public void addAction (EntityUpdateAction action)

public void addAction (EntityIdentityInsertAction insert)

public void addAction (EntityInsertAction action)

public void afterTransactionCompletion (boolean success)

Performs cleanup of any held cache softlocks.

Parameters
success Was the transaction successful.

public boolean areInsertionsOrDeletionsQueued ()

Check whether any insertion or deletion actions are currently queued.

Returns
  • True if insertions or deletions are currently queued; false otherwise.

public boolean areTablesToBeUpdated (Set tables)

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.

public void beforeTransactionCompletion ()

Execute any registered BeforeTransactionCompletionProcess

public void clear ()

public void clearFromFlushNeededCheck (int previousCollectionRemovalSize)

public ArrayList cloneDeletions ()

public static ActionQueue deserialize (ObjectInputStream ois, SessionImplementor session)

Used by the owning session to explicitly control deserialization of the action queue

Parameters
ois The stream from which to read the action queue
session The session to which the action queue belongs
Returns
  • The deserialized action queue
Throws
IOException indicates a problem reading from the stream
ClassNotFoundException Generally means we were unable to locate user classes.

public void execute (Executable executable)

public void executeActions ()

Perform all currently queued actions.

Throws
HibernateException error executing queued actions.

public void executeInserts ()

Perform all currently queued entity-insertion actions.

Throws
HibernateException error executing queued insertion actions.

public boolean hasAfterTransactionActions ()

public boolean hasAnyQueuedActions ()

public boolean hasBeforeTransactionActions ()

public int numberOfCollectionCreations ()

public int numberOfCollectionRemovals ()

public int numberOfCollectionUpdates ()

public int numberOfDeletions ()

public int numberOfInsertions ()

public int numberOfUpdates ()

public void prepareActions ()

Prepares the internal action queues for execution.

Throws
HibernateException error preparing actions.

public void registerProcess (AfterTransactionCompletionProcess process)

public void registerProcess (BeforeTransactionCompletionProcess process)

public void serialize (ObjectOutputStream oos)

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

public void sortActions ()

public void sortCollectionActions ()

public String toString ()

Returns a string representation of the object.

Returns
  • a string representation of the object.