|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.catalog.FarragoReposTxnContext net.sf.farrago.session.mock.MockReposTxnContext
public class MockReposTxnContext
MockReposTxnContext overrides FarragoReposTxnContext so that no FarragoRepos
implementation is needed. Note that this class does not actually create any
transaction or lock. See MockSessionStmtValidator
.
Field Summary | |
---|---|
private boolean |
isRead
|
private boolean |
isWrite
|
private boolean |
locked
|
Constructor Summary | |
---|---|
MockReposTxnContext()
|
Method Summary | |
---|---|
void |
beginLockedTxn(boolean readOnly)
Acquires a repository lock and begins a matching MDR transaction (shared lock for read, or exclusive lock for write). |
void |
beginReadTxn()
Begins a new read-only transaction. |
void |
beginWriteTxn()
Begins a new read/write transaction. |
void |
commit()
Commits the active transaction, if any. |
boolean |
isReadTxnInProgress()
|
boolean |
isTxnInProgress()
|
void |
rollback()
Rolls back the active transaction, if any. |
void |
unlockAfterTxn()
Releases lock acquired by beginLockedTxn. |
Methods inherited from class net.sf.farrago.catalog.FarragoReposTxnContext |
---|
beginExclusiveAccess, endExclusiveAccess, setReposReadOnly |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean isRead
private boolean isWrite
private boolean locked
Constructor Detail |
---|
public MockReposTxnContext()
Method Detail |
---|
public void beginReadTxn()
FarragoReposTxnContext
beginReadTxn
in class FarragoReposTxnContext
public void beginWriteTxn()
FarragoReposTxnContext
beginWriteTxn
in class FarragoReposTxnContext
public void commit()
FarragoReposTxnContext
commit
in class FarragoReposTxnContext
public boolean isReadTxnInProgress()
isReadTxnInProgress
in class FarragoReposTxnContext
public boolean isTxnInProgress()
isTxnInProgress
in class FarragoReposTxnContext
public void rollback()
FarragoReposTxnContext
rollback
in class FarragoReposTxnContext
public void beginLockedTxn(boolean readOnly)
FarragoReposTxnContext
beginLockedTxn
in class FarragoReposTxnContext
readOnly
- if true, a shared lock is acquired on the catalog;
otherwise, an exclusive lock is acquiredpublic void unlockAfterTxn()
FarragoReposTxnContext
unlockAfterTxn
in class FarragoReposTxnContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |