public interface ISession
IStorage
contains multiple resources. To each resource, one ISession
can be
bound.
Transactions can then be started from this instance. There can only be one IBucketWriteTrx
at the
time.
However, multiple IBucketReadTrx
can coexist concurrently:
*
//Ensure, storage and resources are created
final IStorage storage = Storage.openStorage(FILE);
final ISession session =
storage.getSession(new SessionConfiguration(RESOURCENAME, KEY));
final IBucketReadTrx pRtx = session.beginBucketRtx(REVISION);
final IBucketWriteTrx pWtx = session.beginBucketWtx();
Modifier and Type | Method and Description |
---|---|
IBucketReadTrx |
beginBucketRtx(long pRevKey)
Begin exclusive read transaction on the bucket layer
|
IBucketWriteTrx |
beginBucketWtx()
Begin exclusive write transaction on the bucket layer
|
IBucketWriteTrx |
beginBucketWtx(long pRevToRepresent)
Begin exclusive write transaction on the bucket layer with fixed revisions.
|
boolean |
close()
Safely close session and immediately release all resources.
|
boolean |
deregisterBucketTrx(IBucketReadTrx pTrx)
Deregisters a registered bucket transaction.
|
ResourceConfiguration |
getConfig()
Getting the resource configuration
|
long |
getMostRecentVersion()
Getting the most recent version from the storage.
|
void |
setRunningCommit(Future<Void> pRunningCommit)
Setting running commit to session.
|
boolean |
truncate()
Truncating the resource where this
ISession is bound to. |
void |
waitForRunningCommit()
Waiting and blocking for running commit.
|
boolean deregisterBucketTrx(IBucketReadTrx pTrx) throws TTIOException
pTrx
- to be deregistered.TTIOException
ResourceConfiguration getConfig()
long getMostRecentVersion() throws TTIOException
TTIOException
IBucketWriteTrx beginBucketWtx() throws TTException
IBucketReadTrx
instanceTTException
IBucketWriteTrx beginBucketWtx(long pRevToRepresent) throws TTException
pRevToRepresent
- IBucketReadTrx
instanceTTException
IBucketReadTrx beginBucketRtx(long pRevKey) throws TTException
pRevKey
- revision key for the revision askIBucketReadTrx
instanceTTException
boolean close() throws TTException
TTException
- If can't close session.boolean truncate() throws TTException
ISession
is bound to. Note that the session must be closed
first.TTException
- if anything weird happens.void waitForRunningCommit() throws TTIOException
TTIOException
- if something goes weirdCopyright © 2013. All Rights Reserved.