Package net.ontopia.persistence.proxy
Class AbstractTransaction
java.lang.Object
net.ontopia.persistence.proxy.AbstractTransaction
- All Implemented Interfaces:
TransactionIF
- Direct Known Subclasses:
ROTransaction,RWTransaction
INTERNAL: The default proxy transaction implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StorageAccessIFprotected booleanprotected Stringprotected final Map<IdentityIF,PersistentIF> protected booleanprotected booleanprotected booleanprotected Map<IdentityIF,PersistentIF> protected intprotected ObjectRelationalMappingIFprotected ObjectAccessIFprotected AccessRegistrarIFprotected longprotected StorageCacheIF -
Method Summary
Modifier and TypeMethodDescription_getObject(IdentityIF identity) EXPERIMENTAL: ...voidabort()INTERNAL: Aborts the changes performed in the transaction.voidbegin()INTERNAL: Begins a new transaction.protected PersistentIFcheckIdentityMap(IdentityIF identity) protected PersistentIFcheckIdentityMapAndCreateInstance(IdentityIF identity) protected PersistentIFcheckIdentityMapNoLRU(IdentityIF identity) voidclose()INTERNAL: Releases all resources used by the transaction.voidcommit()INTERNAL: Commits the changes performed in the transaction.protected PersistentIFcreateInstance(IdentityIF identity) createQuery(JDOQuery jdoquery, boolean resolve_identities) INTERNAL: Build a QueryIF from the specified JDO query instance.executeQuery(String name, Object[] params) INTERNAL: Executes the named query.protected CollectionextractFieldValues(Object type, int field, Collection<IdentityIF> identities) protected Collection<IdentityIF>extractNonDirty(Collection<IdentityIF> identities) abstract voidflush()INTERNAL: Stores all pending changes in the data repository.INTERNAL: Gets the access registrar used by the transaction.getId()INTERNAL: Gets the transaction id.getObject(IdentityIF identity) INTERNAL: Gets the object instance with the given identity.getObject(IdentityIF identity, boolean acceptDeleted) INTERNAL: Gets the object instance with the given identity.INTERNAL: Gets the object access used by the transaction.protected QueryIFINTERNAL: Gets the storage access used by the transaction.booleanisActive()INTERNAL: Returns true the transaction is active.booleanisFieldLoaded(IdentityIF identity, int field) EXPERIMENTAL:booleanisObjectLoaded(IdentityIF identity) EXPERIMENTAL:<F> FloadField(IdentityIF identity, int field) INTERNAL: Called by PersistentIFs when the value of the specified field is requested.voidobjectMerged(IdentityIF source, IdentityIF target) INTERNAL: Called by other transactions to notify this transaction of committed merges.voidprefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities) voidprefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities) protected voidregisterQuery(String name, QueryIF query) protected PersistentIFremoveIdentityMapNoLRU(IdentityIF identity) toString()protected abstract voidprotected abstract voidprotected abstract voidprotected abstract voidbooleanvalidate()INTERNAL: Returns true if the transaction is valid.voidwriteIdentityMap(Writer out, boolean dump) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.ontopia.persistence.proxy.TransactionIF
assignIdentity, create, delete, isClean, isObjectClean, isReadOnly, objectCreated, objectDeleted, objectDirty, objectRead
-
Field Details
-
debug
protected boolean debug -
isactive
protected boolean isactive -
isclosed
protected boolean isclosed -
isaborted
protected boolean isaborted -
id
-
access
-
txncache
-
registrar
-
oaccess
-
mapping
-
identity_map
-
lru
-
lrusize
protected int lrusize -
querymap
-
timestamp
protected long timestamp
-
-
Method Details
-
getId
Description copied from interface:TransactionIFINTERNAL: Gets the transaction id. This id is unique for a given StorageIF instance.- Specified by:
getIdin interfaceTransactionIF
-
getStorageAccess
Description copied from interface:TransactionIFINTERNAL: Gets the storage access used by the transaction.- Specified by:
getStorageAccessin interfaceTransactionIF
-
isActive
public boolean isActive()Description copied from interface:TransactionIFINTERNAL: Returns true the transaction is active.- Specified by:
isActivein interfaceTransactionIF
-
validate
public boolean validate()Description copied from interface:TransactionIFINTERNAL: Returns true if the transaction is valid.- Specified by:
validatein interfaceTransactionIF
-
begin
public void begin()Description copied from interface:TransactionIFINTERNAL: Begins a new transaction.- Specified by:
beginin interfaceTransactionIF
-
commit
public void commit()Description copied from interface:TransactionIFINTERNAL: Commits the changes performed in the transaction.- Specified by:
commitin interfaceTransactionIF
-
abort
public void abort()Description copied from interface:TransactionIFINTERNAL: Aborts the changes performed in the transaction.- Specified by:
abortin interfaceTransactionIF
-
close
public void close()Description copied from interface:TransactionIFINTERNAL: Releases all resources used by the transaction.- Specified by:
closein interfaceTransactionIF
-
flush
public abstract 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
-
transactionPreCommit
protected abstract void transactionPreCommit() -
transactionPostCommit
protected abstract void transactionPostCommit() -
transactionPreAbort
protected abstract void transactionPreAbort() -
transactionPostAbort
protected abstract void transactionPostAbort() -
getObjectAccess
Description copied from interface:TransactionIFINTERNAL: Gets the object access used by the transaction.- Specified by:
getObjectAccessin interfaceTransactionIF
-
getAccessRegistrar
Description copied from interface:TransactionIFINTERNAL: Gets the access registrar used by the transaction.- Specified by:
getAccessRegistrarin interfaceTransactionIF
-
isObjectLoaded
Description copied from interface:TransactionIFEXPERIMENTAL:- Specified by:
isObjectLoadedin interfaceTransactionIF
-
isFieldLoaded
Description copied from interface:TransactionIFEXPERIMENTAL:- Specified by:
isFieldLoadedin interfaceTransactionIF
-
loadField
Description copied from interface:TransactionIFINTERNAL: Called by PersistentIFs when the value of the specified field is requested. Note that the persistent object will be notified through the _p_setValue method, so there is usually no need to use the return value to set the instance member.- Specified by:
loadFieldin interfaceTransactionIF- Returns:
- the field value that was loaded.
-
objectMerged
INTERNAL: Called by other transactions to notify this transaction of committed merges. Default implementation is empty.- Parameters:
source- The identity of the object merged into targettarget- The identity of the target object that was merged- Since:
- 5.4.0
-
getObject
Description copied from interface:TransactionIFINTERNAL: Gets the object instance with the given identity. If the identity is known not to exist in the data repository an exception will be thrown. Deleted objects will not be returned from this method.- Specified by:
getObjectin interfaceTransactionIF
-
getObject
Description copied from interface:TransactionIFINTERNAL: Gets the object instance with the given identity. If the identity is known not to exist in the data repository an exception will be thrown. Known and still existing object instances of deleted objects will be returned from this method if the acceptDeleted flag is true.- Specified by:
getObjectin interfaceTransactionIF
-
_getObject
Description copied from interface:TransactionIFEXPERIMENTAL: ...- Specified by:
_getObjectin interfaceTransactionIF
-
checkIdentityMapAndCreateInstance
-
checkIdentityMapNoLRU
-
removeIdentityMapNoLRU
-
checkIdentityMap
-
createInstance
-
prefetch
- Specified by:
prefetchin interfaceTransactionIF
-
prefetch
public void prefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities) - Specified by:
prefetchin interfaceTransactionIF
-
extractNonDirty
-
extractFieldValues
-
executeQuery
Description copied from interface:TransactionIFINTERNAL: Executes the named query. The parameters given in the params parameter are used during the execution of the query.- Specified by:
executeQueryin interfaceTransactionIF
-
createQuery
Description copied from interface:TransactionIFINTERNAL: Build a QueryIF from the specified JDO query instance.- Specified by:
createQueryin interfaceTransactionIF
-
getQuery
-
registerQuery
-
writeIdentityMap
- Throws:
IOException
-
toString
-