Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODP.NET Entity Framework Transaction.

3068597Jan 20 2016 — edited Jan 20 2016

Hi, Community Members.

I am using, 
Windows 7 Enterprise as my development machine.

.NET Framework 4.5 as my Framework with Oracle 12 C client.
Database is 11g.

and in my Services.msc
Distributed Transaction Coordinator service is running

OracleOraClient12Home1MTSRecoveryService is also running.

My question is when i am creating an Entity Framework context and Inserting even in a single table (although have to involve 2 oracle tables) using TransactionScope() i am getting the following error.

********************************************************************************************************************************************

                                                  "The underlying provider failed on Open. and innerException says Unable to enlist in a distributed transaction source Oracle Data Provider for .NET".


Stack trace is at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable)

***********************************************************************************************************************************************************

The error comes in when i am doing a simple plain insert and executes the line DbContext.SaveChanges();  function. heres my code for understanding

using   (TransactionScope transaction = new TransactionScope())

{

// my declaration of context and assigning entities.

DbContext.SaveChanges();
transaction.Complete();

}

My objective is simple that i want a transaction base insert so that i accordingly commit and rollback.


Any help/recommendations/clue would be highly appreciated.  Awaiting the response.

Thanks.
Navaid.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 17 2016
Added on Jan 20 2016
0 comments
1,014 views