当调用TransactionScope.Dispose()抛出一个" Aborted transaction"例外

时间:2014-12-05 04:54:00

标签: c# oracle

我有一个操作将数据插入32位Oracle数据库(10.2.0.1.0),当调用Dispose()时抛出一个“Aborted transaction”异常,但数据插入成功。对该操作进行同样的操作64位oracle数据库,但没有出现异常。

var option = new TransactionOptions();
option.IsolationLevel = IsolationLevel.ReadCommitted;
option.Timeout = TimeSpan.FromMinutes(2);
TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, option);
using (OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS=        (PROTOCOL=TCP)(HOST=192.168.116.222)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)));User     ID=strong;Password=strong;"))
    {
        string sqlStr = "INSERT into TEST_USER (CreateTime)values(sysdate)";
        OracleCommand cmd = new OracleCommand();
        cmd.CommandText = sqlStr;
        cmd.Connection = conn;
        conn.Open();
        cmd.ExecuteNonQuery();
    }
scope.Complete();
scope.Dispose();

0 个答案:

没有答案