Interface ITransaction
Interface that represents an active transaction with QLDB.
Every transaction is tied to the parent IQldbSession, meaning that if the parent session is closed or invalidated, the child transaction is automatically closed and cannot be used. Only one transaction can be active at any given time per parent session, and thus every transaction should call Abort() or Commit() when it is no longer needed, or when a new transaction is wanted from the parent session.
Any unexpected errors that occur within a transaction should not be retried using the same transaction, as the state of the transaction is now ambiguous.
When an OCC conflict occurs, the transaction is closed and must be handled manually by creating a new transaction and re-executing the desired queries.
Child Result objects will be closed when the transaction is aborted or committed.
Namespace: Amazon.QLDB.Driver
Assembly: Amazon.QLDB.Driver.dll
Syntax
public interface ITransaction : IDisposable
Methods
| Improve this Doc View SourceAbort()
Aborts the transaction and roll back any changes. Any open IResult created by the transaction will be closed.
Declaration
void Abort()
Commit()
Commits the transaction. Any open IResult created by the transaction will be closed.
Declaration
void Commit()
Execute(String, List<IIonValue>)
Executes the statement using the specified parameters against QLDB and retrieve the result.
Declaration
IResult Execute(string statement, List<IIonValue> parameters = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | statement | PartiQL statement. |
List<IIonValue> | parameters | Ion value parameters. |
Returns
Type | Description |
---|---|
IResult | Result from executed statement. |