Class AbstractTransactionContext

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addTxSynchronizable​(TxSynchronizable synchronizable)
      Register a listener which wants to synchronize its state to the state of the transaction.
      protected void clearConnections()  
      void close()
      Closes all Connections.
      protected abstract void closeConnections()
      The derived class must implement this method and close all the connections used in this transaction.
      void commit()
      Commits all changes and closes the transaction releasing all locks on all objects.
      protected abstract void commitConnections()
      The derived class must implement this method and commit all the connections used in this transaction.
      protected java.util.Iterator<java.sql.Connection> connectionsIterator()  
      void create​(ClassMolder molder, java.lang.Object object, OID depended)
      Creates a new object in persistent storage.
      protected abstract java.sql.Connection createConnection​(LockEngine engine)  
      void delete​(java.lang.Object object)
      Deletes the object from persistent storage.
      void expireCache​(ClassMolder molder, Identity identity)
      Expire object from the cache.
      java.lang.Object fetch​(ClassMolder molder, Identity identity, AccessMode suggestedAccessMode)
      java.lang.ClassLoader getClassLoader()
      Get the current application ClassLoader.
      java.sql.Connection getConnection​(LockEngine engine)
      Return an open connection for the specified engine.
      DbMetaInfo getConnectionInfo​(LockEngine engine)
      Returns meta-data related to the RDBMS used.
      Database getDatabase()
      InstanceFactory getInstanceFactory()  
      int getLockTimeout()
      Returns the timeout waiting to acquire a lock.
      NamedNativeQuery getNamedNativeQuery​(ClassMolder molder, java.lang.String name)
      Returns a NamedNativeQuery instance query based upon a named query as defined in the mapping file.
      java.lang.String getNamedQuery​(ClassMolder molder, java.lang.String name)
      Creates an OQL query based upon a named query as defined in the mapping file.
      int getStatus()
      Returns the status of this transaction.
      int getTransactionTimeout()
      Returns the timeout of this transaction.
      ObjectLock getWaitOnLock()
      Returns the lock which this transaction attempts to acquire.
      boolean isAutoStore()
      Test if autoStore option is enabled or not.
      boolean isCached​(ClassMolder molder, java.lang.Class cls, Identity identity)
      boolean isCreated​(java.lang.Object object)
      Returns true if the object is marked as created in this transaction.
      boolean isDeleted​(java.lang.Object object)
      Returns true if and only if the specified object is loaded or created in this transaction and is deleted.
      boolean isDeletedByOID​(OID oid)
      boolean isDepended​(OID master, java.lang.Object dependent)
      boolean isLocked​(java.lang.Class cls, Identity identity, LockEngine lockEngine)
      Returns true if the object given is locked.
      boolean isOpen()
      Returns true if the transaction is open.
      boolean isPersistent​(java.lang.Object object)
      Returns true if the object is persistent in this transaction.
      boolean isReadOnly​(java.lang.Object object)
      Check to see whether this transaction considers an object to have been marked read-only.
      boolean isRecorded​(java.lang.Object object)
      Returns true if the object has been previously queried/loaded/updated/created in this transaction.
      boolean isUpdateCacheNeeded​(java.lang.Object object)
      Retrieves the state of the object in this transaction.
      boolean isUpdatePersistNeeded​(java.lang.Object object)
      Retrieves the state of the object in this transaction.
      java.util.Iterator iterateReadWriteObjectsInTransaction()
      Expose an enumeration of the commited object entries to allow TxSynchronizable to iterate through the objects.
      java.lang.Object load​(Identity identity, ProposedEntity proposedObject, AccessMode suggestedAccessMode)
      Load an object for use within the transaction.
      java.lang.Object load​(Identity identity, ProposedEntity proposedObject, AccessMode suggestedAccessMode, QueryResults results)
      Load an object for use within the transaction.
      void markCreate​(ClassMolder molder, java.lang.Object object, OID rootObjectOID)
      Walk a data object tree starting from the specified object, and mark all objects to be created.
      void markModified​(java.lang.Object object, boolean updatePersist, boolean updateCache)
      boolean markUpdate​(ClassMolder molder, java.lang.Object object, OID depended)
      Update a new object in persistent storage and returns the object's OID.
      boolean prepare()
      Prepares the transaction prior to committing it.
      QueryResults query​(LockEngine engine, PersistenceQuery query, AccessMode accessMode, boolean scrollable)
      Perform a query using the query mechanism with the specified access mode.
      void removeTxSynchronizable​(TxSynchronizable synchronizable)
      Unregister a listener which wants to synchronize its state to the state of the transaction.
      void rollback()
      Rolls back all changes and closes the transaction releasing all locks on all objects.
      protected abstract void rollbackConnections()
      The derived class must implement this method and rollback all the connections used in this transaction.
      void setAutoStore​(boolean autoStore)
      Enable or disable autoStore.
      void setCallback​(CallbackInterceptor callback)
      Overrides the default callback interceptor by a custom interceptor for this database source.
      void setInstanceFactory​(InstanceFactory factory)
      Overrides the default instance factory by a custom one for this database source.
      void setLockTimeout​(int timeout)
      Sets the timeout waiting to acquire a lock.
      void setStatus​(int status)
      Sets the status of the current transaction to the given one.
      void setTransactionTimeout​(int timeout)
      Sets the timeout of this transaction.
      void setWaitOnLock​(ObjectLock lock)
      Indicates which lock this transaction is waiting for.
      void trackObject​(ClassMolder molder, OID oid, java.lang.Object object)  
      void untrackObject​(java.lang.Object object)  
      void update​(ClassMolder molder, java.lang.Object object, OID depended)
      Update a new object in persistent storage and returns the object's OID.
      void writeLock​(java.lang.Object object, int timeout)
      Acquire a write lock on the object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait