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
-
objectTransactionGuard
- Implements
-
System.IDisposable
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 |
Remarks
To finish the transaction, either call Commit() to apply database operations or Dispose() to rollback the transaction.
Properties
View SourceIsEnabled
The flag representing whether the TransactionGuard is enabled.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
To finish the transaction, either call Commit() to apply database operations or Dispose() to rollback the transaction.
Methods
View SourceCommit()
Commit the transaction.
Declaration
public void Commit()
Remarks
To finish the transaction, either call Commit() to apply database operations or Dispose() to rollback the transaction.
Dispose()
Dispose the object. Rollback the transaction.
Declaration
public void Dispose()
Remarks
To finish the transaction, either call Commit() to apply database operations or Dispose() to rollback the transaction.