在asp.net应用程序中使用transactioncope与oracle 12c第4版时出错 [英] Error while using transactionscope with oracle 12c release 4 in asp.net application

查看:110
本文介绍了在asp.net应用程序中使用transactioncope与oracle 12c第4版时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#网络应用程序中使用TransactionScope,例如



I am using TransactionScope in C# web application like

using (TransactionScope scope = new TransactionScope())
            {
                using (OracleConnection connection1 = new OracleConnection(conn))
                {
                    //  Opening the connection automatically enlists it in the 
                    //  TransactionScope as a lightweight transaction.
                    connection1.Open();

                    //  Create the SqlCommand object and execute the first command.
                }
                scope.Complete();

            }







ODAC 11g这段代码运行正常但12c版本3和4都产生错误






with ODAC 11g this piece of code is running fine but with 12c release 3 and 4 both this is producing error

Oracle.DataAccess.Client.OracleException (0x80004005): Unable to enlist in a distributed transaction at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable, OracleLogicalTransaction m_OracleLogicalTransaction) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src, OracleLogicalTransaction m_oracleLogicalTransaction) at Oracle.DataAccess.Client.OracleConnection.Open() at WebApplication1._Default.Page_Load(Object sender, EventArgs e) 





我尝试过的事情:



我尽可能拥有所有可能编码技巧但是不工作



What I have tried:

I have all the possible coding tricks but not working

推荐答案

请注意,0x80004005不是来自Oracle,它是未指定的故障的标准Windows错误。

可能的原因是丢失文件或访问权限。



我的猜测是Oracle Client安装上缺少访问权限。



我建议你开始在这里阅读 [ ^ ]

请注意,步骤6中的文件名将有所不同。



下一步是阅读这个 [ ^ ]文件。



但至关重要的问题是,你真的需要使用TransactionScope吗? />
如果不是,请使用正常交易并添加Enlist = false;在connectionstring
Note that 0x80004005 does not originate from Oracle, it's a standard windows error for "Unspecified failure".
Possible reasons are missing files or access rights.

My guess is that there are missing access rights on the Oracle Client installation.

I suggest you start reading here [^]
Note that the filenames in step 6 will differ.

Next step is to read this[^] document.

Crucial question though, do you really need to use TransactionScope?
If not, use normal transactions and add Enlist=false; in the connectionstring


这篇关于在asp.net应用程序中使用transactioncope与oracle 12c第4版时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆