Class BackupValueHolder
- java.lang.Object
-
- org.eclipse.persistence.internal.indirection.DatabaseValueHolder
-
- org.eclipse.persistence.internal.indirection.BackupValueHolder
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ValueHolderInterface
,WeavedAttributeValueHolderInterface
public class BackupValueHolder extends DatabaseValueHolder
Used as the backup value holder in the unit of work for transparent indirection. This ensure that a reference to the original value holder is held in case the transparent collection or proxy is replace without first instantiating the original.- Since:
- 10.1.3
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ValueHolderInterface<?>
unitOfWorkValueHolder
Stores the original uow clone's value holder.-
Fields inherited from class org.eclipse.persistence.internal.indirection.DatabaseValueHolder
isCoordinatedWithProperty, isInstantiated, row, session, value
-
Fields inherited from interface org.eclipse.persistence.indirection.ValueHolderInterface
shouldToStringInstantiate
-
-
Constructor Summary
Constructors Constructor Description BackupValueHolder(ValueHolderInterface<?> unitOfWorkValueHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractRecord
getRow()
Return the row.AbstractSession
getSession()
Return the session.ValueHolderInterface<?>
getUnitOfWorkValueHolder()
Return the original uow clone's value holder.Object
instantiate()
If the original value holder was not instantiated, then first instantiate it to obtain the backup value.Object
instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this).boolean
isPessimisticLockingValueHolder()
Answers if this valueholder is a pessimistic locking one.-
Methods inherited from class org.eclipse.persistence.internal.indirection.DatabaseValueHolder
clone, getValue, getValue, getWrappedValueHolder, isCoordinatedWithProperty, isEasilyInstantiated, isInstantiated, isNewlyWeavedValueHolder, isSerializedRemoteUnitOfWorkValueHolder, isTransactionalValueHolder, postInstantiate, privilegedSetValue, releaseWrappedValueHolder, resetFields, setInstantiated, setIsCoordinatedWithProperty, setIsNewlyWeavedValueHolder, setRow, setSession, setUninstantiated, setValue, shouldAllowInstantiationDeferral, toString
-
-
-
-
Field Detail
-
unitOfWorkValueHolder
protected ValueHolderInterface<?> unitOfWorkValueHolder
Stores the original uow clone's value holder.
-
-
Constructor Detail
-
BackupValueHolder
public BackupValueHolder(ValueHolderInterface<?> unitOfWorkValueHolder)
-
-
Method Detail
-
isPessimisticLockingValueHolder
public boolean isPessimisticLockingValueHolder()
Description copied from class:DatabaseValueHolder
Answers if this valueholder is a pessimistic locking one. Such valueholders are special in that they can be triggered multiple times by different UnitsOfWork. Each time a lock query will be issued. Hence even if instantiated it may have to be instantiated again, and once instantiated all fields can not be reset. Note: Implementations of this method are not necessarily thread-safe. They must be used in a synchronizaed manner- Specified by:
isPessimisticLockingValueHolder
in classDatabaseValueHolder
-
instantiateForUnitOfWorkValueHolder
public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
Description copied from class:DatabaseValueHolder
Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this).When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder needs to be triggered directly without triggering the wrapped valueholder. However only the wrapped valueholder knows how to trigger the indirection, i.e. it may be a batchValueHolder, and it stores all the info like the row and the query. Note: Implementations of this method are not necessarily thread-safe. They must be used in a synchronized manner
- Specified by:
instantiateForUnitOfWorkValueHolder
in classDatabaseValueHolder
-
getRow
public AbstractRecord getRow()
Description copied from class:DatabaseValueHolder
Return the row.- Overrides:
getRow
in classDatabaseValueHolder
-
getSession
public AbstractSession getSession()
Description copied from class:DatabaseValueHolder
Return the session.- Overrides:
getSession
in classDatabaseValueHolder
-
instantiate
public Object instantiate()
If the original value holder was not instantiated, then first instantiate it to obtain the backup value.- Specified by:
instantiate
in classDatabaseValueHolder
-
getUnitOfWorkValueHolder
public ValueHolderInterface<?> getUnitOfWorkValueHolder()
Return the original uow clone's value holder.
-
-