public abstract class AbstractTransaction extends Object implements TransactionIF
Modifier and Type | Field and Description |
---|---|
protected StorageAccessIF |
access |
protected boolean |
debug |
protected String |
id |
protected Map<IdentityIF,PersistentIF> |
identity_map |
protected boolean |
isaborted |
protected boolean |
isactive |
protected boolean |
isclosed |
protected Map<IdentityIF,PersistentIF> |
lru |
protected int |
lrusize |
protected ObjectRelationalMappingIF |
mapping |
protected ObjectAccessIF |
oaccess |
protected Map<String,QueryIF> |
querymap |
protected AccessRegistrarIF |
registrar |
protected long |
timestamp |
protected StorageCacheIF |
txncache |
Modifier and Type | Method and Description |
---|---|
PersistentIF |
_getObject(IdentityIF identity)
EXPERIMENTAL: ...
|
void |
abort()
INTERNAL: Aborts the changes performed in the transaction.
|
void |
begin()
INTERNAL: Begins a new transaction.
|
protected PersistentIF |
checkIdentityMap(IdentityIF identity) |
protected PersistentIF |
checkIdentityMapAndCreateInstance(IdentityIF identity) |
protected PersistentIF |
checkIdentityMapNoLRU(IdentityIF identity) |
void |
close()
INTERNAL: Releases all resources used by the transaction.
|
void |
commit()
INTERNAL: Commits the changes performed in the transaction.
|
protected PersistentIF |
createInstance(IdentityIF identity) |
QueryIF |
createQuery(JDOQuery jdoquery,
boolean resolve_identities)
INTERNAL: Build a QueryIF from the specified JDO query instance.
|
Object |
executeQuery(String name,
Object[] params)
INTERNAL: Executes the named query.
|
protected Collection |
extractFieldValues(Object type,
int field,
Collection<IdentityIF> identities) |
protected Collection<IdentityIF> |
extractNonDirty(Collection<IdentityIF> identities) |
abstract void |
flush()
INTERNAL: Stores all pending changes in the data repository.
|
AccessRegistrarIF |
getAccessRegistrar()
INTERNAL: Gets the access registrar used by the transaction.
|
String |
getId()
INTERNAL: Gets the transaction id.
|
PersistentIF |
getObject(IdentityIF identity)
INTERNAL: Gets the object instance with the given identity.
|
PersistentIF |
getObject(IdentityIF identity,
boolean acceptDeleted)
INTERNAL: Gets the object instance with the given identity.
|
ObjectAccessIF |
getObjectAccess()
INTERNAL: Gets the object access used by the transaction.
|
protected QueryIF |
getQuery(String name) |
StorageAccessIF |
getStorageAccess()
INTERNAL: Gets the storage access used by the transaction.
|
boolean |
isActive()
INTERNAL: Returns true the transaction is active.
|
boolean |
isFieldLoaded(IdentityIF identity,
int field)
EXPERIMENTAL:
|
boolean |
isObjectLoaded(IdentityIF identity)
EXPERIMENTAL:
|
<F> F |
loadField(IdentityIF identity,
int field)
INTERNAL: Called by PersistentIFs when the value of the specified
field is requested.
|
void |
objectMerged(IdentityIF source,
IdentityIF target)
INTERNAL: Called by other transactions to notify this transaction of
committed merges.
|
void |
prefetch(Class<?> type,
int[] fields,
boolean[] traverse,
Collection<IdentityIF> identities) |
void |
prefetch(Class<?> type,
int field,
boolean traverse,
Collection<IdentityIF> identities) |
protected void |
registerQuery(String name,
QueryIF query) |
protected PersistentIF |
removeIdentityMapNoLRU(IdentityIF identity) |
String |
toString() |
protected abstract void |
transactionPostAbort() |
protected abstract void |
transactionPostCommit() |
protected abstract void |
transactionPreAbort() |
protected abstract void |
transactionPreCommit() |
boolean |
validate()
INTERNAL: Returns true if the transaction is valid.
|
void |
writeIdentityMap(Writer out,
boolean dump) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
assignIdentity, create, delete, isClean, isObjectClean, isReadOnly, objectCreated, objectDeleted, objectDirty, objectRead
protected boolean debug
protected boolean isactive
protected boolean isclosed
protected boolean isaborted
protected String id
protected StorageAccessIF access
protected StorageCacheIF txncache
protected AccessRegistrarIF registrar
protected ObjectAccessIF oaccess
protected ObjectRelationalMappingIF mapping
protected final Map<IdentityIF,PersistentIF> identity_map
protected Map<IdentityIF,PersistentIF> lru
protected int lrusize
protected long timestamp
public String getId()
TransactionIF
getId
in interface TransactionIF
public StorageAccessIF getStorageAccess()
TransactionIF
getStorageAccess
in interface TransactionIF
public boolean isActive()
TransactionIF
isActive
in interface TransactionIF
public boolean validate()
TransactionIF
validate
in interface TransactionIF
public void begin()
TransactionIF
begin
in interface TransactionIF
public void commit()
TransactionIF
commit
in interface TransactionIF
public void abort()
TransactionIF
abort
in interface TransactionIF
public void close()
TransactionIF
close
in interface TransactionIF
public abstract void flush()
TransactionIF
flush
in interface TransactionIF
protected abstract void transactionPreCommit()
protected abstract void transactionPostCommit()
protected abstract void transactionPreAbort()
protected abstract void transactionPostAbort()
public ObjectAccessIF getObjectAccess()
TransactionIF
getObjectAccess
in interface TransactionIF
public AccessRegistrarIF getAccessRegistrar()
TransactionIF
getAccessRegistrar
in interface TransactionIF
public boolean isObjectLoaded(IdentityIF identity)
TransactionIF
isObjectLoaded
in interface TransactionIF
public boolean isFieldLoaded(IdentityIF identity, int field)
TransactionIF
isFieldLoaded
in interface TransactionIF
public <F> F loadField(IdentityIF identity, int field)
TransactionIF
loadField
in interface TransactionIF
public void objectMerged(IdentityIF source, IdentityIF target)
source
- The identity of the object merged into targettarget
- The identity of the target object that was mergedpublic PersistentIF getObject(IdentityIF identity)
TransactionIF
getObject
in interface TransactionIF
public PersistentIF getObject(IdentityIF identity, boolean acceptDeleted)
TransactionIF
getObject
in interface TransactionIF
public PersistentIF _getObject(IdentityIF identity)
TransactionIF
_getObject
in interface TransactionIF
protected PersistentIF checkIdentityMapAndCreateInstance(IdentityIF identity)
protected PersistentIF checkIdentityMapNoLRU(IdentityIF identity)
protected PersistentIF removeIdentityMapNoLRU(IdentityIF identity)
protected PersistentIF checkIdentityMap(IdentityIF identity)
protected PersistentIF createInstance(IdentityIF identity)
public void prefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities)
prefetch
in interface TransactionIF
public void prefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities)
prefetch
in interface TransactionIF
protected Collection<IdentityIF> extractNonDirty(Collection<IdentityIF> identities)
protected Collection extractFieldValues(Object type, int field, Collection<IdentityIF> identities)
public Object executeQuery(String name, Object[] params)
TransactionIF
executeQuery
in interface TransactionIF
public QueryIF createQuery(JDOQuery jdoquery, boolean resolve_identities)
TransactionIF
createQuery
in interface TransactionIF
public void writeIdentityMap(Writer out, boolean dump) throws IOException
IOException