Couchbase Transactions .NET | 1.1.0
Search Results for

    Show / Hide Table of Contents

    Class AttemptContext

    Inheritance
    Object
    AttemptContext
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Couchbase.Transactions
    Assembly: Couchbase.Transactions.dll
    Syntax
    public class AttemptContext

    Properties

    | Improve this Doc View Source

    AttemptId

    Declaration
    public string AttemptId { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Logger

    Declaration
    public ILogger<AttemptContext> Logger { get; }
    Property Value
    Type Description
    ILogger<AttemptContext>
    | Improve this Doc View Source

    TransactionId

    Declaration
    public string TransactionId { get; }
    Property Value
    Type Description
    String

    Methods

    | Improve this Doc View Source

    BailoutIfInOvertime(Boolean, String)

    Declaration
    protected void BailoutIfInOvertime(bool rollback, string caller = "BailoutIfInOvertime")
    Parameters
    Type Name Description
    Boolean rollback
    String caller
    | Improve this Doc View Source

    CheckExpiryAndThrow(String, String)

    Declaration
    protected void CheckExpiryAndThrow(string docId, string hookPoint)
    Parameters
    Type Name Description
    String docId
    String hookPoint
    | Improve this Doc View Source

    CommitAsync(IRequestSpan)

    Declaration
    public async Task CommitAsync(IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    ConvertQueryError(Exception)

    Declaration
    public Exception ConvertQueryError(Exception err)
    Parameters
    Type Name Description
    Exception err
    Returns
    Type Description
    Exception
    | Improve this Doc View Source

    DoneCheck()

    Declaration
    protected void DoneCheck()
    | Improve this Doc View Source

    ErrorIfExpiredAndNotInExpiryOvertimeMode(String, String, String)

    Declaration
    protected void ErrorIfExpiredAndNotInExpiryOvertimeMode(string hookPoint, string docId = null, string caller = "")
    Parameters
    Type Name Description
    String hookPoint
    String docId
    String caller
    | Improve this Doc View Source

    GetAsync(ICouchbaseCollection, String)

    Gets a document.

    Declaration
    public async Task<TransactionGetResult> GetAsync(ICouchbaseCollection collection, string id)
    Parameters
    Type Name Description
    Couchbase.KeyValue.ICouchbaseCollection collection

    The collection to look up the document in.

    String id

    The ID of the document.

    Returns
    Type Description
    Task<TransactionGetResult>

    A TransactionGetResult containing the document.

    Exceptions
    Type Condition
    Couchbase.Core.Exceptions.KeyValue.DocumentNotFoundException

    If the document does not exist.

    | Improve this Doc View Source

    GetOptionalAsync(ICouchbaseCollection, String, IRequestSpan)

    Gets a document or null.

    Declaration
    public Task<TransactionGetResult> GetOptionalAsync(ICouchbaseCollection collection, string id, IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    Couchbase.KeyValue.ICouchbaseCollection collection

    The collection to look up the document in.

    String id

    The ID of the document.

    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan

    The optional parent tracing span.

    Returns
    Type Description
    Task<TransactionGetResult>

    A TransactionGetResult containing the document, or null if not found.

    | Improve this Doc View Source

    InitAtrIfNeeded(ICouchbaseCollection, String, IRequestSpan)

    Declaration
    protected async Task InitAtrIfNeeded(ICouchbaseCollection collection, string id, IRequestSpan parentSpan)
    Parameters
    Type Name Description
    Couchbase.KeyValue.ICouchbaseCollection collection
    String id
    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    InsertAsync(ICouchbaseCollection, String, Object, IRequestSpan)

    Insert a document.

    Declaration
    public Task<TransactionGetResult> InsertAsync(ICouchbaseCollection collection, string id, object content, IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    Couchbase.KeyValue.ICouchbaseCollection collection

    The collection to insert the document into.

    String id

    The ID of the new document.

    Object content

    The content of the new document.

    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan

    The optional parent tracing span.

    Returns
    Type Description
    Task<TransactionGetResult>

    A TransactionGetResult representing the inserted document.

    | Improve this Doc View Source

    QueryAsync<T>(String, TransactionQueryConfigBuilder, IScope, IRequestSpan)

    Run a query in transaction mode.

    Declaration
    public Task<IQueryResult<T>> QueryAsync<T>(string statement, TransactionQueryConfigBuilder config = null, IScope scope = null, IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    String statement

    The statement to execute.

    TransactionQueryConfigBuilder config

    The configuration to use for this query.

    Couchbase.KeyValue.IScope scope

    The scope

    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan
    Returns
    Type Description
    Task<Couchbase.Query.IQueryResult<T>>

    A SingleQueryTransactionResult<T> with the query results, if any.

    Type Parameters
    Name Description
    T

    The type of the result. Use Object for queries with no results.

    Remarks

    IMPORTANT: Any KV operations after this query will be run via the query engine, which has performance implications.

    | Improve this Doc View Source

    QueryAsync<T>(String, TransactionQueryOptions, IScope, IRequestSpan)

    Run a query in transaction mode.

    Declaration
    public Task<IQueryResult<T>> QueryAsync<T>(string statement, TransactionQueryOptions options, IScope scope = null, IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    String statement

    The statement to execute.

    TransactionQueryOptions options

    The query options to use for this query.

    Couchbase.KeyValue.IScope scope

    The scope

    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan
    Returns
    Type Description
    Task<Couchbase.Query.IQueryResult<T>>

    A SingleQueryTransactionResult<T> with the query results, if any.

    Type Parameters
    Name Description
    T

    The type of the result. Use Object for queries with no results.

    Remarks

    IMPORTANT: Any KV operations after this query will be run via the query engine, which has performance implications.

    | Improve this Doc View Source

    RemoveAsync(TransactionGetResult, IRequestSpan)

    Remove a document previously looked up in this transaction.

    Declaration
    public Task RemoveAsync(TransactionGetResult doc, IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    TransactionGetResult doc

    The TransactionGetResult of a document previously looked up in this transaction.

    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan

    The optional parent tracing span.

    Returns
    Type Description
    Task

    A task representing the asynchronous work.

    | Improve this Doc View Source

    ReplaceAsync(TransactionGetResult, Object, IRequestSpan)

    Replace the content of a document previously fetched in this transaction with new content.

    Declaration
    public Task<TransactionGetResult> ReplaceAsync(TransactionGetResult doc, object content, IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    TransactionGetResult doc

    The TransactionGetResult of a document previously looked up in this transaction.

    Object content

    The updated content.

    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan

    The optional parent tracing span.

    Returns
    Type Description
    Task<TransactionGetResult>

    A TransactionGetResult reflecting the updated content.

    | Improve this Doc View Source

    RollbackAsync(IRequestSpan)

    Rollback the transaction, explicitly.

    Declaration
    public Task RollbackAsync(IRequestSpan parentSpan = null)
    Parameters
    Type Name Description
    Couchbase.Core.Diagnostics.Tracing.IRequestSpan parentSpan

    The optional parent tracing span.

    Returns
    Type Description
    Task

    A task representing the asynchronous work.

    Remarks

    Calling this method on AttemptContext is usually unnecessary, as unhandled exceptions will trigger a rollback automatically.

    Extension Methods

    Extensions.QueryAsync<T>(AttemptContext, String, Action<TransactionQueryOptions>, IScope)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021 Couchbase, Inc.