| java.lang.Object org.ozoneDB.core.Transaction
Transaction | final public class Transaction implements Locker(Code) | | This class represents an internal transaction.
Most methods of this class are synchronized. In fact, this is not strictly
needed because a transaction is invoked by one thread (associated with this
transaction) only.
All public methods are wrapped into try/catch statements to convert thrown
exception into OzoneInternalExc. So the client gets OzoneRemoteExc, if an
object could not be found or something; OzoneInternalExc, if there was a
critical internal error; any other exceptions were thrown by the user code.
author: SMB author: Medium.net version: $Revision: 1.4 $Date: 2002/07/26 12:29:22 $ |
Method Summary | |
public synchronized void | abort(DbCommand command) Once this method is called it MUST cleanup the entire transaction
stuff without exception. | protected ObjectContainer | acquireContainer(ObjectContainer container, int lockLevel) | public ObjectContainer | acquireObjectAndPin(ObjectID id, int lockLevel) Set a lock on the container specified by the given object ID and join
the container to this transaction.
If a container is returned, it is pinned. | public Lockable | blockedByAndPin() | public synchronized void | commit() Commit this transaction. | public ObjectContainer | copyObjectAndPin(ObjectID id) | public ObjectContainer | createObjectAndPin(String className, int access, String name, String sig, Object[] args, ObjectID id) Create a new database object. | public void | deleteObject(ObjectID id) | public boolean | equals(Object obj) | public void | finalize() | public SimpleArrayList | getCallStack() | public Object | getData() | protected long | getDeadlockWaitTimeMaximum() | public TransactionManager | getManager() | protected long | increaseDeadlockWaitTimeMaximum() | public Object | invokeObject(ObjectID id, String methodName, String sig, Object[] args, int lockLevel) | public Object | invokeObject(ObjectID id, int methodIndex, Object[] args, int lockLevel) | public boolean | isBlocked() Returns wether this locker is blocked. | public boolean | isDeadlocked() | protected boolean | isSleeping() | public int | maxLockLevel() | public void | nameObject(ObjectID id, String name) | public OzoneProxy | objectForID(ObjectID id) | public OzoneProxy | objectForName(String name) | public User | owner() | public boolean | performCommand(DbCommand command) | public synchronized void | prepareCommit() | public void | releaseObjectAndUnpin(ObjectContainer objectContainer) The corresponding method to
Transaction.acquireObjectAndPin . | public void | reset() | protected void | setData(Object to) | protected void | setDeadlockWaitTimeMaximum(long to) | public void | setDeadlocked(boolean to) | public void | sleep(long millis) | public int | status() | public synchronized void | stop() | public TransactionID | taID() | public String | toString() |
HASHTABLE_INIT_SIZE | final public static int HASHTABLE_INIT_SIZE(Code) | | |
STATUS_ABORTED | final public static int STATUS_ABORTED(Code) | | Status of a transaction: transaction has been aborted.
|
STATUS_ABORTING | final public static int STATUS_ABORTING(Code) | | Status of a transaction: transaction is about to abort.
|
STATUS_COMMITED | final public static int STATUS_COMMITED(Code) | | Status of a transaction: transaction has been successfully committed.
|
STATUS_COMMITING | final public static int STATUS_COMMITING(Code) | | Status of a transaction: transaction is about to commit.
|
STATUS_NONE | final public static int STATUS_NONE(Code) | | Status of a transaction: transaction is not active.
|
STATUS_PREPARED | final public static int STATUS_PREPARED(Code) | | Status of a transaction: transaction has been successfully prepared.
|
STATUS_PREPARING | final public static int STATUS_PREPARING(Code) | | Status of a transaction: transaction is about to prepare.
|
STATUS_STARTED | final public static int STATUS_STARTED(Code) | | Status of a transaction: transaction has been started.
|
acquireCount | protected int acquireCount(Code) | | |
blocker | protected ObjectID blocker(Code) | | The ID of the object (container) that blocks this transaction.
|
commandCount | protected int commandCount(Code) | | |
deadlockWaitTimeMaximum | protected long deadlockWaitTimeMaximum(Code) | | The maximum time (in milliseconds) to wait after a deadlock.
|
deadlockWaitTimeMaximumMaximum | final protected static long deadlockWaitTimeMaximumMaximum(Code) | | The maximum deadlockWaitTimeMaximum can have. (default: 30 minutes)
|
deadlockWaitTimeMaximumMinimum | final protected static long deadlockWaitTimeMaximumMinimum(Code) | | The minimum deadlockWaitTimeMaximum can have. (default: 1 second)
|
deadlocked | protected boolean deadlocked(Code) | | Are we deadlocked?
|
env | protected transient Env env(Code) | | The environment of this object.
|
maxLockLevel | protected int maxLockLevel(Code) | | |
rollbackOnly | protected boolean rollbackOnly(Code) | | |
sleeping | protected boolean sleeping(Code) | | Is this thread sleeping?
|
startTime | protected long startTime(Code) | | |
status | protected int status(Code) | | |
stopped | protected boolean stopped(Code) | | |
Transaction | public Transaction(Env _env, User _owner)(Code) | | Construct a new transaction.
Parameters: _env - Environment of this transaction. Parameters: _command - Command that will be performed by run(). Parameters: _owner - User that has started this transaction. |
Transaction | public Transaction(TransactionID _taID)(Code) | | Construct a new transaction. THIS TRANSACTION CAN BE USED FOR TESTING
ONLY!
|
abort | public synchronized void abort(DbCommand command) throws IOException, ClassNotFoundException(Code) | | Once this method is called it MUST cleanup the entire transaction
stuff without exception. An exception signals an internal server error.
Note: This may be called after/from prepareCommit() !
|
acquireObjectAndPin | public ObjectContainer acquireObjectAndPin(ObjectID id, int lockLevel) throws ObjectNotFoundExc, IOException, ClassNotFoundException, TransactionExc, TransactionError(Code) | | Set a lock on the container specified by the given object ID and join
the container to this transaction.
If a container is returned, it is pinned. Thus, it has to be unpinned by the caller.
Parameters: id - ObjectID of the container which we try to join to this transaction. Parameters: lockLevel - The lock level we need on this object (container). The container for the specified id, if all was ok. throws: ObjectNotFoundExc - If there is no such object. |
blockedByAndPin | public Lockable blockedByAndPin()(Code) | | Helper method to implement the Locker interface to support deadlock
recognition via core.dr package
|
commit | public synchronized void commit() throws IOException, ClassNotFoundException(Code) | | Commit this transaction. The transaction has to be in PREPARED state.
Ones this method is called it MUST commit the entire transaction
stuff without any exception.
|
getDeadlockWaitTimeMaximum | protected long getDeadlockWaitTimeMaximum()(Code) | | |
increaseDeadlockWaitTimeMaximum | protected long increaseDeadlockWaitTimeMaximum()(Code) | | |
isBlocked | public boolean isBlocked()(Code) | | Returns wether this locker is blocked.
|
isDeadlocked | public boolean isDeadlocked()(Code) | | |
isSleeping | protected boolean isSleeping()(Code) | | |
maxLockLevel | public int maxLockLevel()(Code) | | |
reset | public void reset()(Code) | | |
setDeadlockWaitTimeMaximum | protected void setDeadlockWaitTimeMaximum(long to)(Code) | | |
setDeadlocked | public void setDeadlocked(boolean to)(Code) | | |
sleep | public void sleep(long millis)(Code) | | |
status | public int status()(Code) | | |
stop | public synchronized void stop()(Code) | | |
|
|