Class TransactionGuard

    Definition

    Namespace:
    Tizen.Data.Tdbc
    Assembly:
    Tizen.Data.Tdbc.dll

    This class helps the operation of the statement in a transacted way.

    public class TransactionGuard : IDisposable
    Inheritance
    object
    TransactionGuard
    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 Source

    TransactionGuard(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 Source

    IsEnabled

    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 Source

    Commit()

    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.

    View Source

    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.

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX