Package net.ontopia.persistence.proxy
Class RWTransaction
- java.lang.Object
-
- net.ontopia.persistence.proxy.AbstractTransaction
-
- net.ontopia.persistence.proxy.RWTransaction
-
- All Implemented Interfaces:
TransactionIF
public class RWTransaction extends AbstractTransaction
INTERNAL: The read-write proxy transaction implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<PersistentIF>chgcreprotected Set<PersistentIF>chgdelprotected Set<PersistentIF>chgdtyprotected booleanflushingprotected Map<IdentityIF,IdentityIF>mergesObjectStatesostatesbooleantrackall
-
Constructor Summary
Constructors Constructor Description RWTransaction(StorageAccessIF access)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignIdentity(PersistentIF object)voidcreate(PersistentIF object)INTERNAL: Registers the object with the transaction and marks it for creation in the data repository.voiddelete(PersistentIF object)INTERNAL: Unregisters the object with the transaction and marks it for deletion in the data repository.voidflush()INTERNAL: Stores all pending changes in the data repository.booleanisClean()INTERNAL: Returns true the transaction is clean, i.e.booleanisObjectClean(IdentityIF identity)booleanisReadOnly()INTERNAL: Returns true if this is a read-only transaction.voidobjectCreated(PersistentIF object)voidobjectDeleted(PersistentIF object)voidobjectDirty(PersistentIF object)INTERNAL: Called by PersistentIFs when the object's data has changed.voidobjectMerged(IdentityIF source, IdentityIF target)INTERNAL: Called by other transactions to notify this transaction of committed merges.voidobjectRead(IdentityIF identity)voidprefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities)voidprefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities)voidregisterMerge(TMObject source, TMObject target)INTERNAL: Called by RDBMSTopicMapStore to notify the transaction of a performed merge.protected voidtransactionPostAbort()protected voidtransactionPostCommit()protected voidtransactionPreAbort()protected voidtransactionPreCommit()-
Methods inherited from class net.ontopia.persistence.proxy.AbstractTransaction
_getObject, abort, begin, checkIdentityMap, checkIdentityMapAndCreateInstance, checkIdentityMapNoLRU, close, commit, createInstance, createQuery, executeQuery, extractFieldValues, extractNonDirty, getAccessRegistrar, getId, getObject, getObject, getObjectAccess, getQuery, getStorageAccess, isActive, isFieldLoaded, isObjectLoaded, loadField, registerQuery, removeIdentityMapNoLRU, toString, validate, writeIdentityMap
-
-
-
-
Field Detail
-
trackall
public boolean trackall
-
ostates
public final ObjectStates ostates
-
chgcre
protected Set<PersistentIF> chgcre
-
chgdel
protected Set<PersistentIF> chgdel
-
chgdty
protected Set<PersistentIF> chgdty
-
merges
protected Map<IdentityIF,IdentityIF> merges
-
flushing
protected boolean flushing
-
-
Constructor Detail
-
RWTransaction
public RWTransaction(StorageAccessIF access)
-
-
Method Detail
-
isClean
public boolean isClean()
Description copied from interface:TransactionIFINTERNAL: Returns true the transaction is clean, i.e. no changes have been made.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:TransactionIFINTERNAL: Returns true if this is a read-only transaction.
-
assignIdentity
public void assignIdentity(PersistentIF object)
-
create
public void create(PersistentIF object)
Description copied from interface:TransactionIFINTERNAL: Registers the object with the transaction and marks it for creation in the data repository.
-
delete
public void delete(PersistentIF object)
Description copied from interface:TransactionIFINTERNAL: Unregisters the object with the transaction and marks it for deletion in the data repository.
-
flush
public void flush()
Description copied from interface:TransactionIFINTERNAL: Stores all pending changes in the data repository. Note that the transaction is not commited.- Specified by:
flushin interfaceTransactionIF- Specified by:
flushin classAbstractTransaction
-
objectDirty
public void objectDirty(PersistentIF object)
Description copied from interface:TransactionIFINTERNAL: Called by PersistentIFs when the object's data has changed.
-
objectRead
public void objectRead(IdentityIF identity)
-
objectCreated
public void objectCreated(PersistentIF object)
-
objectDeleted
public void objectDeleted(PersistentIF object)
-
isObjectClean
public boolean isObjectClean(IdentityIF identity)
-
registerMerge
public void registerMerge(TMObject source, TMObject target)
INTERNAL: Called by RDBMSTopicMapStore to notify the transaction of a performed merge.- Parameters:
source-target-
-
objectMerged
public void objectMerged(IdentityIF source, IdentityIF target)
INTERNAL: Called by other transactions to notify this transaction of committed merges. Default implementation is empty. RWTransaction notifies the added and modified objects of the merge, allowing them to update their fields as needed.- Overrides:
objectMergedin classAbstractTransaction- Parameters:
source- The identity of the object merged into targettarget- The identity of the target object that was merged
-
transactionPreCommit
protected void transactionPreCommit()
- Specified by:
transactionPreCommitin classAbstractTransaction
-
transactionPostCommit
protected void transactionPostCommit()
- Specified by:
transactionPostCommitin classAbstractTransaction
-
transactionPreAbort
protected void transactionPreAbort()
- Specified by:
transactionPreAbortin classAbstractTransaction
-
transactionPostAbort
protected void transactionPostAbort()
- Specified by:
transactionPostAbortin classAbstractTransaction
-
prefetch
public void prefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities)
- Specified by:
prefetchin interfaceTransactionIF- Overrides:
prefetchin classAbstractTransaction
-
prefetch
public void prefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities)
- Specified by:
prefetchin interfaceTransactionIF- Overrides:
prefetchin classAbstractTransaction
-
-