Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using TransactionScope in C# web application like

C#
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
Updated 2-Mar-16 2: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
[no name] 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?

1 solution

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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900