Class AbstractTransaction

java.lang.Object
net.ontopia.persistence.proxy.AbstractTransaction
All Implemented Interfaces:
TransactionIF
Direct Known Subclasses:
ROTransaction, RWTransaction

public abstract class AbstractTransaction extends Object implements TransactionIF
INTERNAL: The default proxy transaction implementation.
  • Field Details

  • Method Details

    • getId

      public String getId()
      Description copied from interface: TransactionIF
      INTERNAL: Gets the transaction id. This id is unique for a given StorageIF instance.
      Specified by:
      getId in interface TransactionIF
    • getStorageAccess

      public StorageAccessIF getStorageAccess()
      Description copied from interface: TransactionIF
      INTERNAL: Gets the storage access used by the transaction.
      Specified by:
      getStorageAccess in interface TransactionIF
    • isActive

      public boolean isActive()
      Description copied from interface: TransactionIF
      INTERNAL: Returns true the transaction is active.
      Specified by:
      isActive in interface TransactionIF
    • validate

      public boolean validate()
      Description copied from interface: TransactionIF
      INTERNAL: Returns true if the transaction is valid.
      Specified by:
      validate in interface TransactionIF
    • begin

      public void begin()
      Description copied from interface: TransactionIF
      INTERNAL: Begins a new transaction.
      Specified by:
      begin in interface TransactionIF
    • commit

      public void commit()
      Description copied from interface: TransactionIF
      INTERNAL: Commits the changes performed in the transaction.
      Specified by:
      commit in interface TransactionIF
    • abort

      public void abort()
      Description copied from interface: TransactionIF
      INTERNAL: Aborts the changes performed in the transaction.
      Specified by:
      abort in interface TransactionIF
    • close

      public void close()
      Description copied from interface: TransactionIF
      INTERNAL: Releases all resources used by the transaction.
      Specified by:
      close in interface TransactionIF
    • flush

      public abstract void flush()
      Description copied from interface: TransactionIF
      INTERNAL: Stores all pending changes in the data repository. Note that the transaction is not commited.
      Specified by:
      flush in interface TransactionIF
    • transactionPreCommit

      protected abstract void transactionPreCommit()
    • transactionPostCommit

      protected abstract void transactionPostCommit()
    • transactionPreAbort

      protected abstract void transactionPreAbort()
    • transactionPostAbort

      protected abstract void transactionPostAbort()
    • getObjectAccess

      public ObjectAccessIF getObjectAccess()
      Description copied from interface: TransactionIF
      INTERNAL: Gets the object access used by the transaction.
      Specified by:
      getObjectAccess in interface TransactionIF
    • getAccessRegistrar

      public AccessRegistrarIF getAccessRegistrar()
      Description copied from interface: TransactionIF
      INTERNAL: Gets the access registrar used by the transaction.
      Specified by:
      getAccessRegistrar in interface TransactionIF
    • isObjectLoaded

      public boolean isObjectLoaded(IdentityIF identity)
      Description copied from interface: TransactionIF
      EXPERIMENTAL:
      Specified by:
      isObjectLoaded in interface TransactionIF
    • isFieldLoaded

      public boolean isFieldLoaded(IdentityIF identity, int field)
      Description copied from interface: TransactionIF
      EXPERIMENTAL:
      Specified by:
      isFieldLoaded in interface TransactionIF
    • loadField

      public <F> F loadField(IdentityIF identity, int field)
      Description copied from interface: TransactionIF
      INTERNAL: 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:
      loadField in interface TransactionIF
      Returns:
      the field value that was loaded.
    • objectMerged

      public void objectMerged(IdentityIF source, IdentityIF target)
      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 target
      target - The identity of the target object that was merged
      Since:
      5.4.0
    • getObject

      public PersistentIF getObject(IdentityIF identity)
      Description copied from interface: TransactionIF
      INTERNAL: 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:
      getObject in interface TransactionIF
    • getObject

      public PersistentIF getObject(IdentityIF identity, boolean acceptDeleted)
      Description copied from interface: TransactionIF
      INTERNAL: 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:
      getObject in interface TransactionIF
    • _getObject

      public PersistentIF _getObject(IdentityIF identity)
      Description copied from interface: TransactionIF
      EXPERIMENTAL: ...
      Specified by:
      _getObject in interface TransactionIF
    • checkIdentityMapAndCreateInstance

      protected PersistentIF checkIdentityMapAndCreateInstance(IdentityIF identity)
    • checkIdentityMapNoLRU

      protected PersistentIF checkIdentityMapNoLRU(IdentityIF identity)
    • removeIdentityMapNoLRU

      protected PersistentIF removeIdentityMapNoLRU(IdentityIF identity)
    • checkIdentityMap

      protected PersistentIF checkIdentityMap(IdentityIF identity)
    • createInstance

      protected PersistentIF createInstance(IdentityIF identity)
    • prefetch

      public void prefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities)
      Specified by:
      prefetch in interface TransactionIF
    • prefetch

      public void prefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities)
      Specified by:
      prefetch in interface TransactionIF
    • extractNonDirty

      protected Collection<IdentityIF> extractNonDirty(Collection<IdentityIF> identities)
    • extractFieldValues

      protected Collection extractFieldValues(Object type, int field, Collection<IdentityIF> identities)
    • executeQuery

      public Object executeQuery(String name, Object[] params)
      Description copied from interface: TransactionIF
      INTERNAL: Executes the named query. The parameters given in the params parameter are used during the execution of the query.
      Specified by:
      executeQuery in interface TransactionIF
    • createQuery

      public QueryIF createQuery(JDOQuery jdoquery, boolean resolve_identities)
      Description copied from interface: TransactionIF
      INTERNAL: Build a QueryIF from the specified JDO query instance.
      Specified by:
      createQuery in interface TransactionIF
    • getQuery

      protected QueryIF getQuery(String name)
    • registerQuery

      protected void registerQuery(String name, QueryIF query)
    • writeIdentityMap

      public void writeIdentityMap(Writer out, boolean dump) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object