質問

このオプションをfbtransaction

に設定できる方法
write
nowait
rec_version
read_committed
.

私のコードでは、挿入/更新SQL文を実行する:

FbConnectionStringBuilder fbConnStr = new FbConnectionStringBuilder();

using (FbConnection fbConn = new FbConnection(fbConnStr))
{
   fbConn.Open();
   using (FbTransaction fbTran = fbConn.BeginTransaction())
   {
      using (FbCommand fbCmd = new FbCommand("insert into TEST values (1)", fbConn, fbTran)
      {
         fbCmd.CommandType = CommandType.Text;
         fbCmd.ExecuteNonQuery();
         fbCmd.Transaction.Commit();
      }
   }
   fbConn.Close();
}
.

役に立ちましたか?

解決

FbTransactionOptionsを使用できます。

FbTransaction transaction = Connection.BeginTransaction(
    FbTransactionOptions.ReadCommitted  |
    FbTransactionOptions.Write|
    FbTransactionOptions.RecVersion|
    FbTransactionOptions.NoWait |
    );
.

IsolationLevel

  • IsolationLevel.ReadUncommitted
  • IsolationLevel.ReadCommitted
  • IsolationLevel.RepeatableRead
  • IsolationLevel.Serializable

あなたはできる:

FbTransaction transaction = Connection.BeginTransaction( IsolationLevel.Serializable );
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top