Top Description Inners Fields Constructors Methods
org.hibernate.engine.spi

public Class ActionQueue

extends Object
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.util.ArrayList, .HashMap, .HashSet, .LinkedHashMap, .LinkedList, .List, .Map, .Objects, .Queue, .Set, java.util.concurrent.ConcurrentLinkedQueue, org.hibernate.AssertionFailure, .HibernateException, .PropertyValueException, org.hibernate.action.internal.AbstractEntityInsertAction, .BulkOperationCleanupAction, .CollectionRecreateAction, .CollectionRemoveAction, .CollectionUpdateAction, .EntityActionVetoException, .EntityDeleteAction, .EntityIdentityInsertAction, .EntityInsertAction, .EntityUpdateAction, .OrphanRemovalAction, .QueuedOperationCollectionAction, .UnresolvedEntityInsertActions, org.hibernate.action.spi.AfterTransactionCompletionProcess, .BeforeTransactionCompletionProcess, .Executable, org.hibernate.cache.CacheException, org.hibernate.engine.internal.NonNullableTransientDependencies, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.metadata.ClassMetadata, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.type.CollectionType, .CompositeType, .EntityType, .ForeignKeyDirection, .OneToOneType, .Type

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. The DML operations are queued here until a flush forces them to be executed against the database.
Authors
Steve Ebersole, Gail Badner, Anton Marsden

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract static class
private static class
ActionQueue.AfterTransactionCompletionProcessQueue

Encapsulates behavior needed for after transaction processing

private static class
ActionQueue.BeforeTransactionCompletionProcessQueue

Encapsulates behavior needed for before transaction processing

private static class
ActionQueue.InsertActionSorter

Order the insertions queue such that we group inserts against the same entity together (without violating constraints).

private abstract static class
public static class
ActionQueue.TransactionCompletionProcesses

Wrapper class allowing to bind the same transaction completion process queues in different sessions.

Field Summary

Modifier and TypeField and Description
private ActionQueue.AfterTransactionCompletionProcessQueue
private ActionQueue.BeforeTransactionCompletionProcessQueue
private ExecutableList<CollectionRecreateAction>
private ExecutableList<QueuedOperationCollectionAction>
private ExecutableList<CollectionRemoveAction>
private ExecutableList<CollectionUpdateAction>
private ExecutableList<EntityDeleteAction>
private static final LinkedHashMap<Class<? extends Executable>, ActionQueue.ListProvider<T extends Executable & Comparable<T> & Serializable>>
EXECUTABLE_LISTS_MAP

A LinkedHashMap containing providers for all the ExecutableLists, inserted in execution order

private ExecutableList<AbstractEntityInsertAction>
private transient boolean
private static final CoreMessageLogger
private ExecutableList<OrphanRemovalAction>
private SessionImplementor
session

Deprecated as a consequence of SessionImplementor being deprecated.
private UnresolvedEntityInsertActions
private ExecutableList<EntityUpdateAction>

Constructor Summary

AccessConstructor and Description
public
ActionQueue(SessionImplementor
The session "owning" this queue.
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Constructs an action queue bound to the given session.

Method Summary

Modifier and TypeMethod and Description
public void
addAction(EntityInsertAction
The action representing the entity insertion
action
)

Adds an entity insert action

private <T extends Executable & Comparable<T> & Serializable> void
addAction(Class<T> executableClass, T action)

public void
addAction(EntityIdentityInsertAction
The action representing the entity insertion
action
)

Adds an entity (IDENTITY) insert action

public void
addAction(EntityDeleteAction
The action representing the entity deletion
action
)

Adds an entity delete action

public void
addAction(OrphanRemovalAction
The action representing the orphan removal
action
)

Adds an orphan removal action

public void
addAction(EntityUpdateAction
The action representing the entity update
action
)

Adds an entity update action

public void
addAction(CollectionRecreateAction
The action representing the (re)creation of a collection
action
)

Adds a collection (re)create action

public void
addAction(CollectionRemoveAction
The action representing the removal of a collection
action
)

Adds a collection remove action

public void
addAction(CollectionUpdateAction
The action representing the update of a collection
action
)

Adds a collection update action

public void
addAction(QueuedOperationCollectionAction
The action representing the queued operation
action
)

Adds an action relating to a collection queued operation (extra lazy).

public void
addAction(BulkOperationCleanupAction
The action representing the queued operation
action
)

Adds an action defining a cleanup relating to a bulk operation (HQL/JPQL or Criteria based update/delete)

private void
private void
public void
afterTransactionCompletion(boolean
Was the transaction successful.
success
)

Performs cleanup of any held cache soft locks.

public boolean

Returns:

true if insertions or deletions are currently queued; false otherwise.
areInsertionsOrDeletionsQueued
()

Check whether any insertion or deletion actions are currently queued.

public boolean

Returns:

true if we contain pending actions against any of the given tables; false otherwise.
areTablesToBeUpdated
(Set<E>
The table/query-spaces to check.
tables
)

Check whether the given tables/query-spaces are to be executed against given the currently queued actions.

private static boolean
areTablesToBeUpdated(ExecutableList<?> actions, Set<E> tableSpaces)

private static boolean
public void
public void
checkNoUnresolvedActionsAfterOperation()

Throws org.hibernate.PropertyValueException if there are any unresolved entity insert actions that depend on non-nullable associations with a transient entity.

public void
public void
clearFromFlushNeededCheck(int previousCollectionRemovalSize)

private static String[]
private static String[]
public static ActionQueue

Returns:

The deserialized action queue
deserialize
(ObjectInputStream
The stream from which to read the action queue
ois
,
SessionImplementor
The session to which the action queue belongs
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Used by the owning session to explicitly control deserialization of the action queue.
public <E extends Executable & Comparable<?>> void
execute(E
The action to execute
executable
)

public void
executeActions()

Perform all currently queued actions.

private <E extends Executable & Comparable<?> & Serializable> void
executeActions(ExecutableList<E>
The list of Executable elements to be performed
list
)

Perform org.hibernate.action.spi.Executable#execute() on each element of the list

public void
executeInserts()

Perform all currently queued entity-insertion actions.

public ActionQueue.TransactionCompletionProcesses
public boolean
public boolean
public boolean
public boolean

Returns:

true, if there are unresolved entity insert actions that depend on non-nullable associations with a transient entity; false, otherwise
hasUnresolvedEntityInsertActions
()

Are there unresolved entity insert actions that depend on non-nullable associations with a transient entity?

private void
invalidateSpaces(String...
The spaces to invalidate
spaces
)

This method is now called once per execution of an ExecutableList or once for execution of an Execution.

private boolean
private boolean
public int
public int
public int
public int
public int
public int
public void
prepareActions()

Prepares the internal action queues for execution.

private void
private void
public void
public void
public void
serialize(ObjectOutputStream
The stream to which the action queue should get written
oos
)

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

public void
setTransactionCompletionProcesses(ActionQueue.TransactionCompletionProcesses
Transaction completion processes.
processes
,
boolean
Flag indicating shared transaction context.
isTransactionCoordinatorShared
)

Bind transaction completion processes to make them shared between primary and secondary session.

public void
public void
public String

Returns:

a string representation of the object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private static String
public void
unScheduleDeletion(EntityEntry entry, Object rescuedEntity)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait