public class CommitManager extends Object
Modifier and Type | Field and Description |
---|---|
protected Vector |
commitOrder |
protected IdentityHashtable |
completedCommits |
protected Hashtable |
dataModifications |
protected boolean |
isActive |
protected Vector |
objectsToDelete |
protected IdentityHashtable |
pendingCommits |
protected IdentityHashtable |
postModifyCommits |
protected IdentityHashtable |
preModifyCommits |
protected IdentityHashtable |
processedCommits
Changed the folowing line to work like mergemanager.
|
protected AbstractSession |
session |
protected IdentityHashtable |
shallowCommits |
Constructor and Description |
---|
CommitManager(AbstractSession session)
Create the commit manager on the session.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataModificationEvent(DatabaseMapping mapping,
Object[] event)
Add the data query to be performed at the end of the commit.
|
void |
addObjectToDelete(Object objectToDelete)
Deletion are cached until the end.
|
protected void |
addProcessedCommit(Object domainObject)
add the commit of the object to the processed list.
|
void |
commitAllObjects(IdentityHashtable domainObjects)
Commit all of the objects as a single transaction.
|
protected void |
commitAllObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet,
Class theClass)
Commit all of the objects of the class type in the change set.
|
void |
commitAllObjectsWithChangeSet(UnitOfWorkChangeSet uowChangeSet)
Commit all of the objects as a single transaction.
|
protected void |
commitChangedObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet,
String className)
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.
|
void |
deleteAllObjects(Vector objectsForDeletion)
delete all of the objects as a single transaction.
|
Vector |
getCommitOrder()
Return the order in which objects should be commited to the database.
|
protected IdentityHashtable |
getCompletedCommits()
Return any objects that have been written during this commit process.
|
protected Hashtable |
getDataModifications()
Used to store data querys to be performed at the end of the commit.
|
protected Vector |
getObjectsToDelete()
Deletion are cached until the end.
|
protected IdentityHashtable |
getPendingCommits()
Return any objects that should be written during this commit process.
|
protected IdentityHashtable |
getPostModifyCommits()
Return any objects that should be written during post modify commit process.
|
protected IdentityHashtable |
getPreModifyCommits()
Return any objects that should be written during pre modify commit process.
|
protected IdentityHashtable |
getProcessedCommits()
Return any objects that should be written during this commit process.
|
protected AbstractSession |
getSession()
Return the session that this is managing commits for.
|
protected IdentityHashtable |
getShallowCommits()
Return any objects that have been shallow comitted during this commit process.
|
protected boolean |
hasDataModifications() |
protected boolean |
hasObjectsToDelete() |
void |
initializeCommitOrder()
Reset the commit order from the session's descriptors.
|
boolean |
isActive()
Return if the commit manager is active.
|
boolean |
isCommitCompleted(Object domainObject)
Return if the object has been commited.
|
boolean |
isCommitInPostModify(Object domainObject)
Return if the object is being in progress of being post modify commit.
|
boolean |
isCommitInPreModify(Object domainObject)
Return if the object is being in progress of being pre modify commit.
|
boolean |
isShallowCommitted(Object domainObject)
Return if the object is shallow committed.
|
void |
markCommitCompleted(Object domainObject)
Mark the commit of the object as being fully completed.
|
void |
markPostModifyCommitInProgress(Object domainObject)
Add an object as being in progress of being commited.
|
void |
markPreModifyCommitInProgress(Object domainObject)
Add an object as being in progress of being commited.
|
void |
markShallowCommit(Object domainObject)
Mark the object as shallow committed.
|
void |
reinitialize()
Reset the commits.
|
protected void |
removePendingCommit(Object domainObject)
Remove the commit of the object from pending.
|
void |
setCommitOrder(Vector commitOrder)
Set the order in which objects should be commited to the database.
|
protected void |
setCompletedCommits(IdentityHashtable completedCommits)
Set the objects that have been written during this commit process.
|
protected void |
setDataModifications(Hashtable dataModifications)
Used to store data querys to be performed at the end of the commit.
|
void |
setIsActive(boolean isActive)
Set if the commit manager is active.
|
protected void |
setObjectsToDelete(Vector objectsToDelete)
Deletion are cached until the end.
|
protected void |
setPendingCommits(IdentityHashtable pendingCommits)
Set the objects that should be written during this commit process.
|
protected void |
setPostModifyCommits(IdentityHashtable postModifyCommits)
Set any objects that should be written during post modify commit process.
|
protected void |
setPreModifyCommits(IdentityHashtable preModifyCommits)
Set any objects that should be written during pre modify commit process.
|
protected void |
setProcessedCommits(IdentityHashtable processedCommits)
Set the objects that should be written during this commit process.
|
protected void |
setSession(AbstractSession session)
Set the session that this is managing commits for.
|
protected void |
setShallowCommits(IdentityHashtable shallowCommits)
Set any objects that have been shallow comitted during this commit process.
|
String |
toString()
Print the in progress depth.
|
protected Vector commitOrder
protected IdentityHashtable processedCommits
protected IdentityHashtable pendingCommits
protected IdentityHashtable preModifyCommits
protected IdentityHashtable postModifyCommits
protected IdentityHashtable completedCommits
protected IdentityHashtable shallowCommits
protected AbstractSession session
protected boolean isActive
protected Hashtable dataModifications
protected Vector objectsToDelete
public CommitManager(AbstractSession session)
public void addDataModificationEvent(DatabaseMapping mapping, Object[] event)
public void addObjectToDelete(Object objectToDelete)
protected void addProcessedCommit(Object domainObject)
public void commitAllObjects(IdentityHashtable domainObjects) throws RuntimeException, DatabaseException, OptimisticLockException
public void commitAllObjectsWithChangeSet(UnitOfWorkChangeSet uowChangeSet) throws RuntimeException, DatabaseException, OptimisticLockException
protected void commitAllObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class theClass)
protected void commitNewObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, Class theClass)
protected void commitChangedObjectsForClassWithChangeSet(UnitOfWorkChangeSet uowChangeSet, String className)
public void deleteAllObjects(Vector objectsForDeletion) throws RuntimeException, DatabaseException, OptimisticLockException
public Vector getCommitOrder()
protected IdentityHashtable getCompletedCommits()
protected boolean hasDataModifications()
protected Hashtable getDataModifications()
protected boolean hasObjectsToDelete()
protected Vector getObjectsToDelete()
protected IdentityHashtable getProcessedCommits()
protected IdentityHashtable getPendingCommits()
protected IdentityHashtable getPostModifyCommits()
protected IdentityHashtable getPreModifyCommits()
protected AbstractSession getSession()
protected IdentityHashtable getShallowCommits()
public void initializeCommitOrder()
public boolean isActive()
public boolean isCommitCompleted(Object domainObject)
public boolean isCommitInPostModify(Object domainObject)
public boolean isCommitInPreModify(Object domainObject)
public boolean isShallowCommitted(Object domainObject)
public void markCommitCompleted(Object domainObject)
public void markPostModifyCommitInProgress(Object domainObject)
public void markPreModifyCommitInProgress(Object domainObject)
public void markShallowCommit(Object domainObject)
public void reinitialize()
protected void removePendingCommit(Object domainObject)
public void setCommitOrder(Vector commitOrder)
protected void setCompletedCommits(IdentityHashtable completedCommits)
protected void setDataModifications(Hashtable dataModifications)
public void setIsActive(boolean isActive)
protected void setObjectsToDelete(Vector objectsToDelete)
protected void setPendingCommits(IdentityHashtable pendingCommits)
protected void setProcessedCommits(IdentityHashtable processedCommits)
protected void setPostModifyCommits(IdentityHashtable postModifyCommits)
protected void setPreModifyCommits(IdentityHashtable preModifyCommits)
protected void setSession(AbstractSession session)
protected void setShallowCommits(IdentityHashtable shallowCommits)
Copyright © 2023. All rights reserved.