Use of Devart.Data.Oracle.OracleConnection' for Context connection

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
software931
Posts: 10
Joined: Tue 18 Sep 2012 07:55

Use of Devart.Data.Oracle.OracleConnection' for Context connection

Post by software931 » Thu 20 Sep 2012 08:05

Hello,

I would like to use an connection of type "Devart.Data.Oracle.OracleConnection" to connect to the Entity context.
I want use this type, to use the FailOver feature of DevOrt Oracle Connection.

But I cannot give over an OracleConnection, when I initialize the context. An EntityConnection is expected.

What can I do, to use the feature FailOver an also the entity framework?

Error Message, because the types are totally different:
Cannot convert type 'Devart.Data.Oracle.OracleConnection' to 'System.Data.EntityClient.EntityConnection'

Shalex
Site Admin
Posts: 8240
Joined: Thu 14 Aug 2008 12:44

Re: Use of Devart.Data.Oracle.OracleConnection' for Context connection

Post by Shalex » Fri 21 Sep 2012 15:20

We recommend you to use the DbContext template to generate a descendant of the DbContext class so that you can pass OracleConnection to its constructor: http://msdn.microsoft.com/en-us/library ... 03%29.aspx.

software931
Posts: 10
Joined: Tue 18 Sep 2012 07:55

Re: Use of Devart.Data.Oracle.OracleConnection' for Context connection

Post by software931 » Fri 19 Oct 2012 13:10

The problem is, that for entity objects the connection should be of type
System.data....

But when I want access also Oracle packages, which we have integrated via Oracle Devart Package wizard, then Devart.Data.Oracle is used.


But I want made some changes via Entity and some other via Oracle package.
But this must be done in the same transaction.

But I cannot use the same connection, because they are different types !!!
Entity framework is using System.Data
Package wizard is using Devart.Data.Oracle


How can I proceed?

Shalex
Site Admin
Posts: 8240
Joined: Thu 14 Aug 2008 12:44

Re: Use of Devart.Data.Oracle.OracleConnection' for Context connection

Post by Shalex » Tue 23 Oct 2012 13:58

Please refer to http://msdn.microsoft.com/en-us/library ... 03%29.aspx: as we mentioned in the previous post, you can pass the Devart.Data.Oracle.OracleConnection object to this constructor of the DbContext class. To generate the descendant of the DbContext class, use the DbContext template in Devart Entity Model (*.edml).

Post Reply