Class TransactionGuard
Definition
- Assembly:
- Tizen.Data.Tdbc.dll
This class helps the operation of the statement in a transacted way.
public class TransactionGuard : IDisposable
- Inheritance
-
TransactionGuard
- Implements
Remarks
To finish the transaction, either call Commit() to apply database operations or Dispose() to rollback the transaction.
Examples
Usage:
using (var transaction = new TransationGuard(statement)) {
...
transaction.Commit();
}
Constructors
View SourceTransactionGuard(IStatement, bool)
The constructor of TransactionGuard class.
Declaration
public TransactionGuard(IStatement statement, bool isEnabled = true)
Parameters
| Type | Name | Description |
|---|---|---|
| IStatement | statement | |
| bool | isEnabled |
Properties
View SourceIsEnabled
The flag representing whether the TransactionGuard is enabled.
Declaration
public bool IsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceCommit()
Commit the transaction.
Declaration
public void Commit()
Dispose()
Dispose the object. Rollback the transaction.
Declaration
public void Dispose()