|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ozoneDB.core.ServerComponent | +--org.ozoneDB.core.TransactionManager
The transaction manager is the factory for transactions and locks.
Field Summary | |
protected long |
acquireCount
|
protected boolean |
alsoNotifySomeSleepingTransactions
If we notify all transactions, they not-blocked-ones may wake up from sleeping. |
protected Transaction |
deadlockTA
Used to signal a deadlock and which Transaction should abort. |
protected java.lang.Thread |
exclusiveThread
True if one thread runs exclusively. |
protected DxMap |
taTable
All currently running transactions. |
protected DxMap |
threadTable
In local mode this maps threads to transactions. |
Fields inherited from class org.ozoneDB.core.ServerComponent |
env |
Constructor Summary | |
TransactionManager(Env _env)
|
Method Summary | |
protected void |
abortTransaction(Transaction ta,
DbCommand command)
|
protected void |
beginExclusion()
|
void |
checkDeadlocks()
This method checks for deadlocks between all current transaction. |
void |
checkExclusion()
Blocks execution until there is no thread scheduled for exclusive execution or the exclusive thread is the current thread. |
protected void |
commitTransaction(Transaction ta,
DbCommand command)
|
protected void |
completeTransaction(DbCommand command,
User user)
Perform the specified command within a new transaction. |
Transaction |
currentTA()
der aktuelle thread is auch die aktuelle transaktion (wenn der thread ueberhaupt eine transaktion ist) |
void |
deleteTransaction()
Delete the transaction that is associated with the current thread. |
protected void |
endExclusion()
|
void |
handleCommand(DbCommand command,
DbInvokeClient client)
Handle the specified command on behalf of the current thread/transaction. |
void |
handleCommand(DbCommand command,
User user)
Handle the specified command on behalf of the current thread/transaction. |
boolean |
isDeadlockTA(Transaction ta)
Check if the given transaction should abort because of a deadlock. |
Lock |
newLock()
Factory method to generate proper Lock objects. |
Transaction |
newTransaction(User owner)
|
void |
notifyWaitingTransactions()
Notify each thread that is associated with a currently blocked transaction by calling notifyAll() on the blocked transaction. |
protected boolean |
performCommand(Transaction ta,
DbCommand command)
Perform the specified command on behalf of the specified thread/transaction. |
protected boolean |
prepareTransaction(Transaction ta,
DbCommand command)
Prepare the specified transaction. |
void |
save()
Save the internal state in the state to the server state properties. |
void |
shutdown()
|
void |
startGarbageCollectionWaitForCurrentTransactionsToCompletePhase(GarbageCollector garbageCollector)
Starts the GarbageColection pre-phase. |
void |
startup()
Start up and load the internal state from the server state properties. |
Transaction |
taForID(TransactionID taID)
|
int |
taTableCount()
|
Methods inherited from class org.ozoneDB.core.ServerComponent |
clearChanged, hasChanged, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DxMap taTable
protected DxMap threadTable
protected Transaction deadlockTA
protected java.lang.Thread exclusiveThread
protected long acquireCount
protected boolean alsoNotifySomeSleepingTransactions
Constructor Detail |
public TransactionManager(Env _env)
Method Detail |
public void startup() throws java.lang.Exception
ServerComponent
startup
in class ServerComponent
java.lang.Exception
public void shutdown() throws java.lang.Exception
shutdown
in class ServerComponent
java.lang.Exception
public void save() throws java.lang.Exception
ServerComponent
save
in class ServerComponent
java.lang.Exception
public Lock newLock()
public int taTableCount()
public Transaction taForID(TransactionID taID)
public Transaction currentTA()
public Transaction newTransaction(User owner) throws org.ozoneDB.TransactionExc
org.ozoneDB.TransactionExc
public void deleteTransaction()
public void notifyWaitingTransactions()
public void handleCommand(DbCommand command, DbInvokeClient client)
public void handleCommand(DbCommand command, User user)
protected void completeTransaction(DbCommand command, User user) throws java.lang.Exception
java.lang.Exception
protected boolean performCommand(Transaction ta, DbCommand command) throws java.lang.Exception
java.lang.Exception
- Any exception always signals an internal error.protected boolean prepareTransaction(Transaction ta, DbCommand command) throws java.lang.Exception
java.lang.Exception
protected void commitTransaction(Transaction ta, DbCommand command) throws java.lang.Exception
java.lang.Exception
protected void abortTransaction(Transaction ta, DbCommand command) throws java.lang.Exception
java.lang.Exception
public void checkExclusion()
protected void beginExclusion()
protected void endExclusion()
public void checkDeadlocks() throws java.lang.Exception
java.lang.Exception
public boolean isDeadlockTA(Transaction ta)
public void startGarbageCollectionWaitForCurrentTransactionsToCompletePhase(GarbageCollector garbageCollector)
|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |