Package io.bdeploy.bhive
Class BHiveTransactions
java.lang.Object
io.bdeploy.bhive.BHiveTransactions
Keeps track of running operations in the JVM.
Uses MarkerDatabase to synchronize with other JVMs which might have operations running as well.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents a writing transaction in the BHive. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbegin()Begins a new transaction on this thread.longThis method can be used to detect and clean stale transactions which may keep (potentially damaged) objects alive.voidTransactions are inherited by default.booleanvoidtouchObject(ObjectId object)
-
Constructor Details
-
BHiveTransactions
-
-
Method Details
-
detachThread
public void detachThread()Transactions are inherited by default. If this is not desired, this method can be used to explicitly detach the current Thread from its parent (and potential sibling threads). -
touchObject
- Parameters:
object- the object which should be considered "touched", i.e. inserted.
-
hasTransaction
public boolean hasTransaction()- Returns:
- whether the current thread has an associated transaction.
-
begin
Begins a new transaction on this thread.Inserts on the
ObjectDatabaseof aBHivewill use this transaction to keep track of objects inserted.- Returns:
- a
BHiveTransactions.Transactionwhich will cleanup associated resources when closed.
-
cleanStaleTransactions
public long cleanStaleTransactions()This method can be used to detect and clean stale transactions which may keep (potentially damaged) objects alive.- Returns:
- the amount of stale transactions found (and removed).
-