Page 1 of 1

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

Posted: Thu 20 Sep 2012 08:05
by software931
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'

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

Posted: Fri 21 Sep 2012 15:20
by Shalex
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.

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

Posted: Fri 19 Oct 2012 13:10
by software931
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?

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

Posted: Tue 23 Oct 2012 13:58
by Shalex
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).