Can't use Entity Framework and Enterprise Library together

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
kcottrell
Posts: 2
Joined: Thu 28 Oct 2010 21:12

Can't use Entity Framework and Enterprise Library together

Post by kcottrell » Thu 28 Oct 2010 21:25

I am working on an application that uses the Entity Framework for most of its database access but occasionally it needs to run a random SQL query - for this I am using Enterprise Library.

I have each piece working correctly by itself with the devArt libraries but if I run an Enterprise Library ExecuteDataSet() after a LINQ to Entity query I get the following error:

Can not load Oracle client. Check your PATH environment variable and registry settings.

I am Closing the connection and calling Dispose on my Entity Context before the Enterprise Library call but that makes no difference.

If I make the Enterprise Library call first and then the Entity Query everything works perfectly - except that I can no longer make EntLib calls.

My guess is that the EF call is blocking the EntLib call but I don't know how to fix this.

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

Post by Shalex » Fri 29 Oct 2010 13:00

We cannot reproduce the mentioned issue in our environment with the 5.70.180 version of dotConnect for Oracle and Enterprise Library v 5.0. We have sent you a test project. Please modify it and send it to us so that we can reproduce the issue in our environment. If you didn't receive our e-mail, please check your spam filter and send me (alexsh at devart*com) your another e-mail address that will not reject attachments.

Please note:
1) I were using identical connection strings for Entity Framework and Enterprise Library;
2) my Oracle Client was 11.1, and what is yours?
3) it is not a good practise to use several Oracle Clients in the same application: http://www.devart.com/forums/viewtopic.php?t=17218;
4) try executing this code to find out what exactly your application is missing: http://www.devart.com/forums/viewtopic.php?t=15458.

kcottrell
Posts: 2
Joined: Thu 28 Oct 2010 21:12

Post by kcottrell » Fri 29 Oct 2010 16:27

Thank you for the test project - it helped me pinpoint what was wrong.

In my connection string for the Enterprise Library I did not have the "Home=ORACLIENT10g" attribute.

I don't remember ever seeing/using this in the past but I did notice it is part of the Entity Framework connection strings generated by the EF wizard.

And now it is in my Enterprise Library connection strings.

Also, the "HOME" attribute is not in your Enterprise Library DataAccessQuickStart example - maybe you could add it in future releases.

Anyhow, it works. Thanks again!

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

Post by Shalex » Mon 01 Nov 2010 10:15

If you do not specify the Home connection string parameter, the default Oracle Home will be used. If your default Oracle Home is not ORACLIENT10g, this is a reason of the problem in your application: libraries of two different Oracle Clients are loaded to the same process.

Post Reply