|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.fennel.FennelTxnContext
public class FennelTxnContext
FennelTxnContext manages the state of at most one Fennel transaction. A context may be inactive, meaning it has no current transaction.
Field Summary | |
---|---|
private FennelDbHandle |
fennelDbHandle
|
private long |
hTxn
|
private FarragoMetadataFactory |
metadataFactory
|
private boolean |
readOnly
|
Constructor Summary | |
---|---|
FennelTxnContext(FarragoMetadataFactory metadataFactory,
FennelDbHandle fennelDbHandle)
Creates a new FennelTxnContext object. |
Method Summary | |
---|---|
void |
commit()
Commits the current txn, if any. |
private FemSvptHandle |
getFemSvptHandle(FennelSvptHandle fennelSvptHandle)
|
FennelDbHandle |
getFennelDbHandle()
|
long |
getRawTxnHandle()
You really don't want to use this. |
long |
getTxnCsn()
Retrieves the commit sequence number associated with the current transaction |
FemTxnHandle |
getTxnHandle()
|
(package private) long |
getTxnHandleLong()
Gets the handle to the current txn. |
void |
initiateReadOnlyTxn()
Starts a read-only transaction; no transaction is allowed to be in progress already. |
void |
initiateTxn()
Forces a transaction to begin unless one is already in progress. |
void |
initiateTxnWithCsn(long csn)
Starts a transaction with a commit sequence number so the transaction will read data based on a specific snapshot time. |
boolean |
isTxnInProgress()
|
FennelSvptHandle |
newSavepoint()
Creates a new savepoint, starting a new transaction if necessary. |
FennelStreamGraph |
newStreamGraph(FarragoAllocationOwner owner)
Wrapper for executeCmd in the case where cmd is a FemCmdCreateExecutionStreamGraph. |
private void |
onEndOfTxn()
|
void |
rollback()
Rolls back the current txn, if any. |
void |
rollbackToSavepoint(FennelSvptHandle fennelSvptHandle)
Rolls back to an existing savepoint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final FarragoMetadataFactory metadataFactory
private final FennelDbHandle fennelDbHandle
private long hTxn
private boolean readOnly
Constructor Detail |
---|
public FennelTxnContext(FarragoMetadataFactory metadataFactory, FennelDbHandle fennelDbHandle)
metadataFactory
- FarragoMetadataFactory for creating Fem instancesfennelDbHandle
- handle to database affected by txns in this contextMethod Detail |
---|
public FennelDbHandle getFennelDbHandle()
public void initiateTxn()
public void initiateReadOnlyTxn()
public void initiateTxnWithCsn(long csn)
csn
- the commit sequence numberlong getTxnHandleLong()
public FemTxnHandle getTxnHandle()
public long getRawTxnHandle()
public boolean isTxnInProgress()
public long getTxnCsn()
public void commit()
public void rollback()
private void onEndOfTxn()
public FennelSvptHandle newSavepoint()
public void rollbackToSavepoint(FennelSvptHandle fennelSvptHandle)
fennelSvptHandle
- handle to savepoint to rollback toprivate FemSvptHandle getFemSvptHandle(FennelSvptHandle fennelSvptHandle)
public FennelStreamGraph newStreamGraph(FarragoAllocationOwner owner)
owner
- the object which will be made responsible for the stream
graph's allocation as a result of this call
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |