| Modifier and Type | Field and Description |
|---|---|
| protected int | commitDepth
Counter used to keep track of commit depth for non-UOW writes. |
| protected List | commitOrder
Order based on mapping foreign key constraints on how to insert objects by class. |
| protected Map | commitState
This tracks the commit state for the objects, PENDING, PRE, POST, COMPLETE. |
| protected static final Integer | COMPLETE
The commit is complete for the object. |
| protected Map | dataModifications
Map of modification events used to defer insertion into m-m, dc, join tables. |
| protected Map | deferredCalls
Map of deferred calls groups by their table. |
| protected static final Integer | IGNORE
This object should be ignored. |
| protected boolean | isActive
The commit manager is active while writing a set of objects (UOW), it is not active when writing a single object (DB session). |
| protected List | objectsToDelete
List of orphaned objects pending deletion. |
| protected static final Integer | POST
The commit is in progress, and the row has been written. |
| protected static final Integer | PRE
The commit is in progress, but the row has not been written. |
| protected AbstractSession | |
| protected Map | shallowCommits
Set of objects that had partial row written to resolve constraints. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addDataModificationEvent(DatabaseMapping mapping, Object[] event)
Add the data query to be performed at the end of the commit. |
| public void | addDeferredCall(DatabaseTable table, DatasourceCall call, DatabaseQueryMechanism mechanism)
Add the data query to be performed at the end of the commit. |
| public void | |
| protected void | commitAllObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class<?> theClass)
Commit all of the objects of the class type in the change set. |
| public void | commitAllObjectsWithChangeSet(UnitOfWorkChangeSet uowChangeSet)
Commit all of the objects as a single transaction. |
| protected void | commitChangedObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class<?> theClass)
Commit changed of the objects of the class type in the change set. |
| protected void | commitNewObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class<?> theClass)
Commit all of the objects of the class type in the change set. |
| public void | |
| public void | deleteAllObjects(Class<?> theClass, List<E> objects, AbstractSession session)
Delete all of the objects with the matching class. |
| public List | |
| protected Map | |
| protected Map | |
| protected Map | |
| public List | |
| protected AbstractSession | |
| protected Map | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| public void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isCommitInPostModify(Object object)
Return if the object is being in progress of being post modify commit. |
| public boolean | isCommitInPreModify(Object objectOrChangeSet)
Return if the object is being in progress of being pre modify commit. |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setCommitOrder(List<E> commitOrder)
Set the order in which objects should be committed to the database. |
| protected void | setDataModifications(Map<DatabaseMapping, List<Object[]>> dataModifications)
Used to store data queries to be performed at the end of the commit. |
| public void | |
| protected void | |
| protected void | |
| protected void | setShallowCommits(Map<K, V> shallowCommits)
Set any objects that have been shallow committed during this commit process. |
| private List | |
| public String |
| commitDepth | back to summary |
|---|---|
| protected int commitDepth Counter used to keep track of commit depth for non-UOW writes. | |
| commitOrder | back to summary |
|---|---|
| protected List<Class<?>> commitOrder Order based on mapping foreign key constraints on how to insert objects by class. | |
| commitState | back to summary |
|---|---|
| protected Map<Object, Integer> commitState This tracks the commit state for the objects, PENDING, PRE, POST, COMPLETE. The key is the object and the value is the state. | |
| COMPLETE | back to summary |
|---|---|
| protected static final Integer COMPLETE The commit is complete for the object. | |
| dataModifications | back to summary |
|---|---|
| protected Map<DatabaseMapping, List<Object[]>> dataModifications Map of modification events used to defer insertion into m-m, dc, join tables. | |
| deferredCalls | back to summary |
|---|---|
| protected Map<DatabaseTable, List<Object[]>> deferredCalls Map of deferred calls groups by their table. This is used to defer multiple table writes for batching and deadlock avoidance. | |
| IGNORE | back to summary |
|---|---|
| protected static final Integer IGNORE This object should be ignored. | |
| isActive | back to summary |
|---|---|
| protected boolean isActive The commit manager is active while writing a set of objects (UOW), it is not active when writing a single object (DB session). | |
| objectsToDelete | back to summary |
|---|---|
| protected List<E> objectsToDelete List of orphaned objects pending deletion. | |
| POST | back to summary |
|---|---|
| protected static final Integer POST The commit is in progress, and the row has been written. | |
| PRE | back to summary |
|---|---|
| protected static final Integer PRE The commit is in progress, but the row has not been written. | |
| session | back to summary |
|---|---|
| protected AbstractSession session | |
| shallowCommits | back to summary |
|---|---|
| protected Map<K, V> shallowCommits Set of objects that had partial row written to resolve constraints. | |
| CommitManager | back to summary |
|---|---|
| public CommitManager(AbstractSession session) Create the commit manager on the session. It must be initialized later on after the descriptors have been added. | |
| addDataModificationEvent | back to summary |
|---|---|
| public void addDataModificationEvent(DatabaseMapping mapping, Object[] event) Add the data query to be performed at the end of the commit. This is done to decrease dependencies and avoid deadlock. | |
| addDeferredCall | back to summary |
|---|---|
| public void addDeferredCall(DatabaseTable table, DatasourceCall call, DatabaseQueryMechanism mechanism) Add the data query to be performed at the end of the commit. This is done to decrease dependencies and avoid deadlock. | |
| addObjectToDelete | back to summary |
|---|---|
| public void addObjectToDelete(Object objectToDelete) Deletion are cached until the end. | |
| commitAllObjectsForClassWithChangeSet | back to summary |
|---|---|
| protected void commitAllObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class<?> theClass) Commit all of the objects of the class type in the change set. This allows for the order of the classes to be processed optimally. | |
| commitAllObjectsWithChangeSet | back to summary |
|---|---|
| public void commitAllObjectsWithChangeSet(UnitOfWorkChangeSet uowChangeSet) throws RuntimeException, DatabaseException, OptimisticLockException Commit all of the objects as a single transaction. This should commit the object in the correct order to maintain referential integrity. | |
| commitChangedObjectsForClassWithChangeSet | back to summary |
|---|---|
| protected void commitChangedObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class<?> theClass) Commit changed of the objects of the class type in the change set. This allows for the order of the classes to be processed optimally. | |
| commitNewObjectsForClassWithChangeSet | back to summary |
|---|---|
| protected void commitNewObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class<?> theClass) Commit all of the objects of the class type in the change set. This allows for the order of the classes to be processed optimally. | |
| deleteAllObjects | back to summary |
|---|---|
| public void deleteAllObjects(List<E> objects) throws RuntimeException, DatabaseException, OptimisticLockException delete all of the objects as a single transaction. This should delete the object in the correct order to maintain referential integrity. | |
| deleteAllObjects | back to summary |
|---|---|
| public void deleteAllObjects(Class<?> theClass, List<E> objects, AbstractSession session) Delete all of the objects with the matching class. | |
| getCommitOrder | back to summary |
|---|---|
| public List Return the order in which objects should be committed to the database. This order is based on ownership in the descriptors and is require for referential integrity. The commit order is a vector of vectors, where the first vector is all root level classes, the second is classes owned by roots and so on. | |
| getCommitState | back to summary |
|---|---|
| protected Map Return the map of states of the objects being committed. The states are defined as static Integers (PENDING, PRE, POST, COMPLETE). | |
| getDataModifications | back to summary |
|---|---|
| protected Map Used to store data queries to be performed at the end of the commit. This is done to decrease dependencies and avoid deadlock. | |
| getDeferredCalls | back to summary |
|---|---|
| protected Map Used to store calls to be performed at the end of the commit. This is done for multiple table descriptors to allow batching and avoid deadlock. | |
| getObjectsToDelete | back to summary |
|---|---|
| public List Deletion are cached until the end. | |
| getSession | back to summary |
|---|---|
| protected AbstractSession getSession() Return the session that this is managing commits for. | |
| getShallowCommits | back to summary |
|---|---|
| protected Map Return any objects that have been shallow committed during this commit process. | |
| hasDataModifications | back to summary |
|---|---|
| protected boolean hasDataModifications() | |
| hasDeferredCalls | back to summary |
|---|---|
| protected boolean hasDeferredCalls() | |
| hasObjectsToDelete | back to summary |
|---|---|
| protected boolean hasObjectsToDelete() | |
| initializeCommitOrder | back to summary |
|---|---|
| public void initializeCommitOrder() Reset the commit order from the session's descriptors. This uses the constraint dependencies in the descriptor's mappings, to decide which descriptors are dependent on which other descriptors. Multiple computations of the commit order should produce the same ordering. This is done to improve performance on unit of work writes through decreasing the stack size, and acts as a deadlock avoidance mechanism. | |
| isActive | back to summary |
|---|---|
| public boolean isActive() Return if the commit manager is active. | |
| isCommitCompleted | back to summary |
|---|---|
| public boolean isCommitCompleted(Object object) Return if the object has been committed. This should be called by any query that is writing an object, if true the query should not write the object. | |
| isCommitCompletedInPostOrIgnore | back to summary |
|---|---|
| public boolean isCommitCompletedInPostOrIgnore(Object object) Return if the object has been committed. This should be called by any query that is writing an object, if true the query should not write the object. | |
| isCommitInPostModify | back to summary |
|---|---|
| public boolean isCommitInPostModify(Object object) Return if the object is being in progress of being post modify commit. This should be called by any query that is writing an object. | |
| isCommitInPreModify | back to summary |
|---|---|
| public boolean isCommitInPreModify(Object objectOrChangeSet) Return if the object is being in progress of being pre modify commit. This should be called by any query that is writing an object, if true the query must force a shallow insert of the object if it is new. | |
| isProcessedCommit | back to summary |
|---|---|
| public boolean isProcessedCommit(Object object) Return if the object has been processed. This should be called by any query that is writing an object, if true the query should not write the object. | |
| isShallowCommitted | back to summary |
|---|---|
| public boolean isShallowCommitted(Object object) Return if the object is shallow committed. This is required to resolve bidirectional references. | |
| markCommitCompleted | back to summary |
|---|---|
| public void markCommitCompleted(Object object) Mark the commit of the object as being fully completed. This should be called by any query that has finished writing an object. | |
| markIgnoreCommit | back to summary |
|---|---|
| public void markIgnoreCommit(Object object) | |
| markPostModifyCommitInProgress | back to summary |
|---|---|
| public void markPostModifyCommitInProgress(Object object) Add an object as being in progress of being committed. This should be called by any query that is writing an object. | |
| markPreModifyCommitInProgress | back to summary |
|---|---|
| public void markPreModifyCommitInProgress(Object object) Add an object as being in progress of being committed. This should be called by any query that is writing an object. | |
| markShallowCommit | back to summary |
|---|---|
| public void markShallowCommit(Object object) Mark the object as shallow committed. This is required to resolve bidirectional references. | |
| reinitialize | back to summary |
|---|---|
| public void reinitialize() Reset the commits. This must be done before a new commit process is begun. | |
| setCommitOrder | back to summary |
|---|---|
| public void setCommitOrder(List<E> commitOrder) Set the order in which objects should be committed to the database. This order is based on ownership in the descriptors and is require for referential integrity. The commit order is a vector of vectors, where the first vector is all root level classes, the second is classes owned by roots and so on. | |
| setDataModifications | back to summary |
|---|---|
| protected void setDataModifications(Map<DatabaseMapping, List<Object[]>> dataModifications) Used to store data queries to be performed at the end of the commit. This is done to decrease dependencies and avoid deadlock. | |
| setIsActive | back to summary |
|---|---|
| public void setIsActive(boolean isActive) Set if the commit manager is active. | |
| setObjectsToDelete | back to summary |
|---|---|
| protected void setObjectsToDelete(List<E> objectsToDelete) Deletion are cached until the end. | |
| setSession | back to summary |
|---|---|
| protected void setSession(AbstractSession session) Set the session that this is managing commits for. | |
| setShallowCommits | back to summary |
|---|---|
| protected void setShallowCommits(Map<K, V> shallowCommits) Set any objects that have been shallow committed during this commit process. | |
| sort | back to summary |
|---|---|
| private List Sort the objects based on PK. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Print the in progress depth.
| |