C# 클래스 LightningDB.LightningTransaction

Represents a transaction.
상속: IDisposable
파일 보기 프로젝트 열기: CoreyKaylor/Lightning.NET 1 사용 예제들

공개 메소드들

메소드 설명
Abort ( ) : void

Abandon all the operations of the transaction instead of saving them. All cursors opened within the transaction will be closed by this call. The cursors and transaction handle will be freed and must not be used again after this call.

BeginTransaction ( ) : LightningTransaction

Begins a child transaction.

BeginTransaction ( TransactionBeginFlags beginFlags ) : LightningTransaction

Begin a child transaction.

Commit ( ) : void

Commit all the operations of a transaction into the database. All cursors opened within the transaction will be closed by this call. The cursors and transaction handle will be freed and must not be used again after this call.

ContainsKey ( LightningDatabase db, byte key ) : bool

Check whether data exists in database.

CreateCursor ( LightningDatabase db ) : LightningDB.LightningCursor

Create a cursor. Cursors are associated with a specific transaction and database and may not span threads.

Delete ( LightningDatabase db, byte key ) : void

Delete items from a database. This function removes key/data pairs from the database. If the database does not support sorted duplicate data items (MDB_DUPSORT) the data parameter is ignored. If the database supports sorted duplicates and the data parameter is NULL, all of the duplicate data items for the key will be deleted. Otherwise, if the data parameter is non-NULL only the matching data item will be deleted. This function will return MDB_NOTFOUND if the specified key/data pair is not in the database.

Delete ( LightningDatabase db, byte key, byte value ) : void

Delete items from a database. This function removes key/data pairs from the database. If the database does not support sorted duplicate data items (MDB_DUPSORT) the data parameter is ignored. If the database supports sorted duplicates and the data parameter is NULL, all of the duplicate data items for the key will be deleted. Otherwise, if the data parameter is non-NULL only the matching data item will be deleted. This function will return MDB_NOTFOUND if the specified key/data pair is not in the database.

Dispose ( ) : void

Dispose this transaction and deallocate all resources associated with it (including databases).

DropDatabase ( LightningDatabase database ) : void

Drops the database.

Equals ( object obj ) : bool
Get ( LightningDatabase db, byte key ) : byte[]

Get value from a database.

GetEntriesCount ( LightningDatabase db ) : long

The number of items in the database.

GetHashCode ( ) : int
Handle ( ) : IntPtr
OpenDatabase ( string name = null, DatabaseConfiguration configuration = null ) : LightningDatabase

Opens a database in context of this transaction.

Put ( LightningDatabase db, byte key, byte value, PutOptions options = PutOptions.None ) : void

Put data into a database.

Renew ( ) : void

Renew current transaction.

Reset ( ) : void

Reset current transaction.

TruncateDatabase ( LightningDatabase database ) : void

Truncates all data from the database.

TryGet ( LightningDatabase db, byte key, byte &value ) : bool

Tries to get a value by its key.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Abort this transaction and deallocate all resources associated with it (including databases).

비공개 메소드들

메소드 설명
LightningTransaction ( LightningEnvironment environment, LightningTransaction parent, TransactionBeginFlags flags ) : System

Created new instance of LightningTransaction

OnParentStateChanging ( LightningTransactionState state ) : void

메소드 상세

Abort() 공개 메소드

Abandon all the operations of the transaction instead of saving them. All cursors opened within the transaction will be closed by this call. The cursors and transaction handle will be freed and must not be used again after this call.
public Abort ( ) : void
리턴 void

BeginTransaction() 공개 메소드

Begins a child transaction.
public BeginTransaction ( ) : LightningTransaction
리턴 LightningTransaction

BeginTransaction() 공개 메소드

Begin a child transaction.
public BeginTransaction ( TransactionBeginFlags beginFlags ) : LightningTransaction
beginFlags TransactionBeginFlags Options for a new transaction.
리턴 LightningTransaction

Commit() 공개 메소드

Commit all the operations of a transaction into the database. All cursors opened within the transaction will be closed by this call. The cursors and transaction handle will be freed and must not be used again after this call.
public Commit ( ) : void
리턴 void

ContainsKey() 공개 메소드

Check whether data exists in database.
public ContainsKey ( LightningDatabase db, byte key ) : bool
db LightningDatabase Database.
key byte Key.
리턴 bool

CreateCursor() 공개 메소드

Create a cursor. Cursors are associated with a specific transaction and database and may not span threads.
public CreateCursor ( LightningDatabase db ) : LightningDB.LightningCursor
db LightningDatabase A database.
리턴 LightningDB.LightningCursor

Delete() 공개 메소드

Delete items from a database. This function removes key/data pairs from the database. If the database does not support sorted duplicate data items (MDB_DUPSORT) the data parameter is ignored. If the database supports sorted duplicates and the data parameter is NULL, all of the duplicate data items for the key will be deleted. Otherwise, if the data parameter is non-NULL only the matching data item will be deleted. This function will return MDB_NOTFOUND if the specified key/data pair is not in the database.
public Delete ( LightningDatabase db, byte key ) : void
db LightningDatabase A database handle returned by mdb_dbi_open()
key byte The key to delete from the database
리턴 void

Delete() 공개 메소드

Delete items from a database. This function removes key/data pairs from the database. If the database does not support sorted duplicate data items (MDB_DUPSORT) the data parameter is ignored. If the database supports sorted duplicates and the data parameter is NULL, all of the duplicate data items for the key will be deleted. Otherwise, if the data parameter is non-NULL only the matching data item will be deleted. This function will return MDB_NOTFOUND if the specified key/data pair is not in the database.
public Delete ( LightningDatabase db, byte key, byte value ) : void
db LightningDatabase A database handle returned by mdb_dbi_open()
key byte The key to delete from the database
value byte The data to delete (optional)
리턴 void

Dispose() 공개 메소드

Dispose this transaction and deallocate all resources associated with it (including databases).
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Abort this transaction and deallocate all resources associated with it (including databases).
protected Dispose ( bool disposing ) : void
disposing bool True if called from Dispose.
리턴 void

DropDatabase() 공개 메소드

Drops the database.
public DropDatabase ( LightningDatabase database ) : void
database LightningDatabase
리턴 void

Equals() 공개 메소드

public Equals ( object obj ) : bool
obj object
리턴 bool

Get() 공개 메소드

Get value from a database.
public Get ( LightningDatabase db, byte key ) : byte[]
db LightningDatabase Database
key byte Key byte array.
리턴 byte[]

GetEntriesCount() 공개 메소드

The number of items in the database.
public GetEntriesCount ( LightningDatabase db ) : long
db LightningDatabase The database we are counting items in.
리턴 long

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int

Handle() 공개 메소드

public Handle ( ) : IntPtr
리턴 System.IntPtr

OpenDatabase() 공개 메소드

Opens a database in context of this transaction.
public OpenDatabase ( string name = null, DatabaseConfiguration configuration = null ) : LightningDatabase
name string Database name (optional). If null then the default name is used.
configuration DatabaseConfiguration Database open options.
리턴 LightningDatabase

Put() 공개 메소드

Put data into a database.
public Put ( LightningDatabase db, byte key, byte value, PutOptions options = PutOptions.None ) : void
db LightningDatabase Database.
key byte Key byte array.
value byte Value byte array.
options PutOptions Operation options (optional).
리턴 void

Renew() 공개 메소드

Renew current transaction.
public Renew ( ) : void
리턴 void

Reset() 공개 메소드

Reset current transaction.
public Reset ( ) : void
리턴 void

TruncateDatabase() 공개 메소드

Truncates all data from the database.
public TruncateDatabase ( LightningDatabase database ) : void
database LightningDatabase
리턴 void

TryGet() 공개 메소드

Tries to get a value by its key.
public TryGet ( LightningDatabase db, byte key, byte &value ) : bool
db LightningDatabase Database.
key byte Key byte array.
value byte Value byte array if exists.
리턴 bool