Click here to Skip to main content
13,297,266 members (71,340 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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();
 
            }



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
Posted 23-Feb-16 1:22am
Updated 2-Mar-16 3:29am
Comments
Richard Deeming 23-Feb-16 8:21am
   
This thread[^] claims it's a know issue in Oracle 10g. The only suggestion in the thread is to upgrade to Oracle 11g R2.
Asp_Learner 23-Feb-16 8:45am
   
Thanks for comment ,any other solution I have already checked that link
Praveen_Kumar Gupta 24-Feb-16 2:15am
   
While you did not get a specific error message, there's a good chance that there is an incompatibility with ODP.Net (version numbers, 32bit vs 64bit DLLs) installed locally vs. on your test server.

TRY to use ODTwithODAC121021.zip
Asp_Learner 24-Feb-16 7:08am
   
That's not the point ,I already told that its supporting ODAC 11g ,but not 12c release 3 and 4 ,we want to upgrade the application
Jörgen Andersson 2-Mar-16 5:43am
   
How many connections are you using in the TransactionScope?
Asp_Learner 2-Mar-16 7:43am
   
only 1 ,point is that why it is running fine with 11g but not with 12c

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01 | 2.8.171207.1 | Last Updated 2 Mar 2016
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100