コード例 #1
0
        /// <summary>
        /// Initializes a <see cref="AceQLTransaction"/>object. This will put the remote connection in auto commit mode off.
        /// </summary>
        /// <returns>A new <see cref="AceQLTransaction"/> object.</returns>
        /// <exception cref="AceQL.Client.Api.AceQLException">If any Exception occurs.</exception>
        public async Task <AceQLTransaction> BeginTransactionAsync()
        {
            TestConnectionOpened();
            await aceQLHttpApi.CallApiNoResultAsync("set_auto_commit", "false").ConfigureAwait(false);

            AceQLTransaction aceQLTransaction = new AceQLTransaction(this);

            return(aceQLTransaction);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new <see cref="AceQLTransaction"/>object with the specified isolation level.
        /// This will put the remote connection in auto commit mode off.
        /// </summary>
        /// <param name="isolationLevel">The isolation level.</param>
        /// <returns>A new <see cref="AceQLTransaction"/> object.</returns>
        /// <exception cref="AceQL.Client.Api.AceQLException">If any Exception occurs.</exception>
        public async Task <AceQLTransaction> BeginTransactionAsync(IsolationLevel isolationLevel)
        {
            TestConnectionOpened();
            await aceQLHttpApi.CallApiNoResultAsync("set_auto_commit", "false").ConfigureAwait(false);

            string isolationLevelStr = AceQLTransaction.GetTransactionIsolationAsString(isolationLevel);
            await aceQLHttpApi.CallApiNoResultAsync("set_transaction_isolation_level", isolationLevelStr).ConfigureAwait(false);

            AceQLTransaction aceQLTransaction = new AceQLTransaction(this, isolationLevel);

            return(aceQLTransaction);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AceQLCommand"/> class with the text of the query and a
 /// <see cref="AceQLConnection"/>, and the <see cref="AceQLTransaction"/>.
 /// </summary>
 /// <param name="cmdText">The text of the query.</param>
 /// <param name="connection">A <see cref="AceQLConnection"/> that represents the connection to a remote database.</param>
 /// <param name="transaction">A <see cref="AceQLTransaction"/>.</param>
 /// <exception cref="System.ArgumentNullException">
 /// If cmdText is null or connection or transaction is null.
 /// </exception>
 public AceQLCommand(string cmdText, AceQLConnection connection, AceQLTransaction transaction) : this(cmdText, connection)
 {
     this.transaction = transaction ?? throw new ArgumentNullException("transaction is null!");
 }