| Modifier and Type | Field and Description |
|---|---|
| protected transient Set | classesToBeInvalidated
Contains classes that should be invalidated in the shared cache on commit. |
| protected UnitOfWorkChangeSet | cumulativeUOWChangeSet
Used to store the final UnitOfWorkChangeSet for merge into the shared cache |
| protected boolean | discoverUnregisteredNewObjectsWithoutPersist
Alters the behaviour of the RWUOW commit to function like the UOW with respect to Entity lifecycle |
| protected transient String | flushClearCache
The FlashClearCache mode to be used. |
| protected boolean | isWithinFlush
Track whether we are already in a flush(). |
| protected boolean | shouldStoreBypassCache
Used to determine if we should bypass any merge into the cache. |
| protected boolean | shouldTerminateTransaction
Used to determine if UnitOfWork should commit and rollback transactions. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected ClassDescriptor | Returns: ClassDescriptorOverrides org. |
| public void | clear(boolean shouldClearCache)
Overrides org. |
| public void | |
| public void | clearForClose(boolean shouldClearCache)
Overrides org. |
| protected Object | cloneAndRegisterNewObject(Object original, boolean isShallowClone)
Overrides org. |
| public void | commitRootUnitOfWork()
Overrides org. |
| public void | commitTransaction()
Overrides org. |
| public void | discoverUnregisteredNewObjects(Map<K, V> clones, Map<K, V> newObjects, Map<K, V> unregisteredExistingObjects, Map<K, V> visitedObjects)
Overrides org. |
| public Set | getClassesToBeInvalidated()
INTERNAL: Return classes that should be invalidated in the shared cache on commit. |
| public UnitOfWorkChangeSet | getCumulativeUOWChangeSet()
INTERNAL: Get the final UnitOfWorkChangeSet for merge into the shared cache. |
| public String | |
| public Object | getUnregisteredDeletedCloneForOriginal(Object original)
INTERNAL: Called only by UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent method. |
| public boolean | isAfterWriteChangesButBeforeCommit()
Overrides org. |
| public boolean | isObjectDeleted(Object object)
Overrides org. |
| public void | issueSQLbeforeCompletion()
Overrides org. |
| public boolean | |
| protected void | mergeChangesIntoParent()
Overrides org. |
| public Object | mergeCloneWithReferences(Object rmiClone, MergeManager manager)
Overrides org. |
| public Object | registerNewObject(Object newObject)
Overrides org. Implements org. |
| protected void | registerNotRegisteredNewObjectForPersist(Object newObject, ClassDescriptor descriptor)
Overrides org. |
| public void | rollbackTransaction()
Overrides org. |
| protected void | rollbackTransaction(boolean
whether we were inside a commit or just trying to
write out changes early. intendedToCommitTransaction)Overrides org. |
| public void | setCumulativeUOWChangeSet(UnitOfWorkChangeSet cumulativeUOWChangeSet)
INTERNAL: Set the final UnitOfWorkChangeSet for merge into the shared cache. |
| public void | setDiscoverUnregisteredNewObjectsWithoutPersist(boolean
the discoverUnregisteredNewObjectsWithoutPersist to set discoverUnregisteredNewObjectsWithoutPersist)
|
| public void | |
| public void | |
| public void | |
| public boolean | shouldClearForCloseOnRelease()
Overrides org. |
| public boolean | Returns: the discoverUnregisteredNewObjectsWithoutPersist
|
| public boolean | shouldForceReadFromDB(ObjectBuildingQuery query, Object primaryKey)
Overrides org. |
| public boolean | shouldStoreBypassCache()
Overrides org. |
| public void | synchronizeAndResume()
Overrides org. |
| public void | updateChangeTrackersIfRequired(Object objectToWrite, ObjectChangeSet changeSetToWrite, UnitOfWorkImpl uow, ClassDescriptor descriptor)
Overrides org. |
| public boolean | wasDeleted(Object original)
Overrides org. |
| public void | writeChanges()
Overrides org. Implements org. |
| classesToBeInvalidated | back to summary |
|---|---|
| protected transient Set<ClassDescriptor> classesToBeInvalidated Contains classes that should be invalidated in the shared cache on commit. Used only in case fushClearCache == FlushClearCache.DropInvalidate: clear method copies contents of updatedObjectsClasses to this set, adding classes of deleted objects, too; on commit the classes contained here are invalidated in the shared cache and the set is cleared. Relevant only in case call to flush method followed by call to clear method. Works together with flushClearCache. | |
| cumulativeUOWChangeSet | back to summary |
|---|---|
| protected UnitOfWorkChangeSet cumulativeUOWChangeSet Used to store the final UnitOfWorkChangeSet for merge into the shared cache | |
| discoverUnregisteredNewObjectsWithoutPersist | back to summary |
|---|---|
| protected boolean discoverUnregisteredNewObjectsWithoutPersist Alters the behaviour of the RWUOW commit to function like the UOW with respect to Entity lifecycle | |
| flushClearCache | back to summary |
|---|---|
| protected transient String flushClearCache The FlashClearCache mode to be used. Initialized by setUnitOfWorkChangeSet method in case it's null; commitAndResume sets this attribute back to null. Relevant only in case call to flush method followed by call to clear method. | |
| isWithinFlush | back to summary |
|---|---|
| protected boolean isWithinFlush Track whether we are already in a flush(). | |
| shouldStoreBypassCache | back to summary |
|---|---|
| protected boolean shouldStoreBypassCache Used to determine if we should bypass any merge into the cache. This is a JPA flag and is true when the cacheStoreMode property is set to BYPASS. Otherwise, EclipseLink behaves as it usually would. | |
| shouldTerminateTransaction | back to summary |
|---|---|
| protected boolean shouldTerminateTransaction Used to determine if UnitOfWork should commit and rollback transactions. This is used when an EntityTransaction is controlling the transaction. | |
| RepeatableWriteUnitOfWork | back to summary |
|---|---|
| public RepeatableWriteUnitOfWork() | |
| RepeatableWriteUnitOfWork | back to summary |
|---|---|
| public RepeatableWriteUnitOfWork(AbstractSession parentSession, ReferenceMode referenceMode) | |
| checkHierarchyForDescriptor | back to summary |
|---|---|
| protected ClassDescriptor checkHierarchyForDescriptor(Class<?> theClass) Overrides org. Check to see if the descriptor of a superclass can be used to describe this class By default, in JPA, classes must have specific descriptors to be considered entities In this implementation, we check whether the inheritance policy has been configured to allow superclass descriptors to describe subclasses that do not have a descriptor themselves
| |
| clear | back to summary |
|---|---|
| public void clear(boolean shouldClearCache) Overrides org. INTERNAL: This method will clear all registered objects from this UnitOfWork. If parameter value is 'true' then the cache(s) are cleared, too.
| |
| clearFlushClearCache | back to summary |
|---|---|
| public void clearFlushClearCache() INTERNAL: Clears invalidation list. | |
| clearForClose | back to summary |
|---|---|
| public void clearForClose(boolean shouldClearCache) Overrides org. INTERNAL: Call this method if the uow will no longer used for committing transactions: all the changes sets will be dereferenced, and (optionally) the cache cleared. If the uow is not released, but rather kept around for ValueHolders, then identity maps shouldn't be cleared: the parameter value should be 'false'. The lifecycle set to Birth so that uow ValueHolder still could be used. Alternatively, if called from release method then everything should go and therefore parameter value should be 'true'. In this case lifecycle won't change - uow.release (optionally) calls this method when it (uow) is already dead. The reason for calling this method from release is to free maximum memory right away: the uow might still be referenced by objects using UOWValueHolders (though they shouldn't be around they still might).
| |
| cloneAndRegisterNewObject | back to summary |
|---|---|
| protected Object cloneAndRegisterNewObject(Object original, boolean isShallowClone) Overrides org. INTERNAL: To avoid putting the original object into the shared cache, and therefore, impede the 'detaching' of the original after commit, a clone of the original should be registered not the actual original object. This is a JPA override to traditional EclipseLink behavior.
| |
| commitRootUnitOfWork | back to summary |
|---|---|
| public void commitRootUnitOfWork() throws DatabaseException, OptimisticLockException Overrides org. INTERNAL: Commit the changes to any objects to the parent.
| |
| commitTransaction | back to summary |
|---|---|
| public void commitTransaction() throws DatabaseException Overrides org. INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow. The uow shares its parents transactions.
| |
| discoverUnregisteredNewObjects | back to summary |
|---|---|
| public void discoverUnregisteredNewObjects(Map<K, V> clones, Map<K, V> newObjects, Map<K, V> unregisteredExistingObjects, Map<K, V> visitedObjects) Overrides org. INTERNAL: Traverse the object to find references to objects not registered in this unit of work. Any unregistered new objects found will be persisted or an error will be thrown depending on the mapping's cascade persist. References to deleted objects will also currently cause them to be undeleted.
| |
| getClassesToBeInvalidated | back to summary |
|---|---|
| public Set INTERNAL: Return classes that should be invalidated in the shared cache on commit. Used only in case fushClearCache == FlushClearCache.DropInvalidate: clear method copies contents of updatedObjectsClasses to this set, adding classes of deleted objects, too; on commit the classes contained here are invalidated in the shared cache and the set is cleared. Relevant only in case call to flush method followed by call to clear method. Works together with flushClearCache. | |
| getCumulativeUOWChangeSet | back to summary |
|---|---|
| public UnitOfWorkChangeSet getCumulativeUOWChangeSet() INTERNAL: Get the final UnitOfWorkChangeSet for merge into the shared cache. | |
| getFlushClearCache | back to summary |
|---|---|
| public String getFlushClearCache() Return the FlashClearCache mode to be used. Relevant only in case call to flush method followed by call to clear method. | |
| getUnregisteredDeletedCloneForOriginal | back to summary |
|---|---|
| public Object getUnregisteredDeletedCloneForOriginal(Object original) INTERNAL: Called only by UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent method. Return unregisteredDeletedClone corresponding to the passed original, or null | |
| isAfterWriteChangesButBeforeCommit | back to summary |
|---|---|
| public boolean isAfterWriteChangesButBeforeCommit() Overrides org. INTERNAL: Has writeChanges() been attempted on this UnitOfWork? It may have either succeeded or failed but either way the UnitOfWork is in a highly restricted state.
| |
| isObjectDeleted | back to summary |
|---|---|
| public boolean isObjectDeleted(Object object) Overrides org. INTERNAL: Return if the object has been deleted in this unit of work.
| |
| issueSQLbeforeCompletion | back to summary |
|---|---|
| public void issueSQLbeforeCompletion() Overrides org. INTERNAL: For synchronized units of work, dump SQL to database
| |
| isWithinFlush | back to summary |
|---|---|
| public boolean isWithinFlush() Return whether we are already performing a flush() call | |
| mergeChangesIntoParent | back to summary |
|---|---|
| protected void mergeChangesIntoParent() Overrides org. INTERNAL: Merge the changes to all objects to the parent.
| |
| mergeCloneWithReferences | back to summary |
|---|---|
| public Object mergeCloneWithReferences(Object rmiClone, MergeManager manager) Overrides org. INTERNAL: Merge the attributes of the clone into the unit of work copy.
| |
| registerNewObject | back to summary |
|---|---|
| public Object registerNewObject(Object newObject) Overrides org. Implements org. ADVANCED: Register the new object with the unit of work. This will register the new object without cloning. Normally the registerObject method should be used for all registration of new and existing objects. This version of the register method can only be used for new objects. This method should only be used if a new object is desired to be registered without cloning.
| |
| registerNotRegisteredNewObjectForPersist | back to summary |
|---|---|
| protected void registerNotRegisteredNewObjectForPersist(Object newObject, ClassDescriptor descriptor) Overrides org. INTERNAL: Called only by registerNewObjectForPersist method, and only if newObject is not already registered. If newObject is found in unregisteredDeletedObjectsCloneToBackupAndOriginal then it's re-registered, otherwise the superclass method called.
| |
| rollbackTransaction | back to summary |
|---|---|
| public void rollbackTransaction() throws DatabaseException Overrides org. INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow. The uow shares its parents transactions.
| |
| rollbackTransaction | back to summary |
|---|---|
| protected void rollbackTransaction(boolean intendedToCommitTransaction) throws DatabaseException Overrides org. INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow. The uow shares its parents transactions. Called in JTA this should not set the transaction to rollback.
| |
| setCumulativeUOWChangeSet | back to summary |
|---|---|
| public void setCumulativeUOWChangeSet(UnitOfWorkChangeSet cumulativeUOWChangeSet) INTERNAL: Set the final UnitOfWorkChangeSet for merge into the shared cache. | |
| setDiscoverUnregisteredNewObjectsWithoutPersist | back to summary |
|---|---|
public void setDiscoverUnregisteredNewObjectsWithoutPersist(boolean discoverUnregisteredNewObjectsWithoutPersist)
| |
| setFlushClearCache | back to summary |
|---|---|
| public void setFlushClearCache(String flushClearCache) Set the FlashClearCache mode to be used. Relevant only in case call to flush method followed by call to clear method. | |
| setShouldStoreByPassCache | back to summary |
|---|---|
| public void setShouldStoreByPassCache(boolean shouldStoreBypassCache) | |
| setShouldTerminateTransaction | back to summary |
|---|---|
| public void setShouldTerminateTransaction(boolean shouldTerminateTransaction) | |
| shouldClearForCloseOnRelease | back to summary |
|---|---|
| public boolean shouldClearForCloseOnRelease() Overrides org. INTERNAL: Indicates whether clearForClose method should be called by release method.
| |
| shouldDiscoverUnregisteredNewObjectsWithoutPersist | back to summary |
|---|---|
public boolean shouldDiscoverUnregisteredNewObjectsWithoutPersist()
| |
| shouldForceReadFromDB | back to summary |
|---|---|
| public boolean shouldForceReadFromDB(ObjectBuildingQuery query, Object primaryKey) Overrides org. INTERNAL: Calculate whether we should read directly from the database to the UOW. This will be necessary, if a flush and a clear have been called on this unit of work In that case, there will be changes in the database that are not in the shared cache, so a read in this UOW should get info directly form the DB
| |
| shouldStoreBypassCache | back to summary |
|---|---|
| public boolean shouldStoreBypassCache() Overrides org. INTERNAL: Returns true if the UOW should bypass any updated to the shared cache during the merge.
| |
| synchronizeAndResume | back to summary |
|---|---|
| public void synchronizeAndResume() Overrides org. INTERNAL Synchronize the clones and update their backup copies. Called after commit and commit and resume.
| |
| updateChangeTrackersIfRequired | back to summary |
|---|---|
| public void updateChangeTrackersIfRequired(Object objectToWrite, ObjectChangeSet changeSetToWrite, UnitOfWorkImpl uow, ClassDescriptor descriptor) Overrides org. INTERNAL: This method is used internally to update the tracked objects if required
| |
| wasDeleted | back to summary |
|---|---|
| public boolean wasDeleted(Object original) Overrides org. INTERNAL: Return if the object was deleted previously (in a flush).
| |
| writeChanges | back to summary |
|---|---|
| public void writeChanges() Overrides org. Implements org. INTERNAL: This will flush all changes to the database, and create or merge into the cumulativeUOWChangeSet.
| |