Weird EF Connection Problem - Help!

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
tcurtis
Posts: 13
Joined: Thu 14 Jan 2010 16:52

Weird EF Connection Problem - Help!

Post by tcurtis » Fri 19 Mar 2010 14:26

Hi all

Pulling my hair out with a very strange problem and have now got to the point where I don't know what else to try.

I have two WCF services. They are both contained in the same project in the same solution. They both use the same EF model which is in a separate class library in the same solution.

When call Service A multiple times it works perfectly. When I call Service B multiple times it works fine. If I call Service A and then call Service B then the call to Service B fails with the error shown below. If I call Service B and then call Service A then same error. In other words, the first call always works (and subsequent calls to the same service), but as soon as I call another service I get the error. Weird!

The error:

System.InvalidOperationException: The 'Devart.Data.Oracle.OracleProviderFactory' provider from the specified SSDL artifact(s) does not match the expected 'Devart.Data.Oracle' provider from the connection string.
at System.Data.EntityClient.EntityConnection.ValidateThatConnectionAndMetadataProvidersAreEqual(DbProviderFactory connectionFactory, String connectionProviderName, DbProviderFactory metadataFactory)
at System.Data.EntityClient.EntityConnection.LoadStoreItemCollections(MetadataWorkspace workspace, DbConnection storeConnection, DbProviderFactory factory, DbConnectionOptions connectionOptions, EdmItemCollection edmItemCollection, MetadataArtifactLoader artifactLoader)
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.EntityClient.EntityConnection.InitializeMetadata(DbConnection newConnection, DbConnection originalConnection, Boolean closeOriginalConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at BSkyB.com.BSS.Model.Traffic.Conn.Get(String serviceID, Boolean open, ConnOverride connOverride, ILog log) in C:\Dev\BSkyB.com.BSS\BSkyB.com.BSS.Model\BSkyB.com.BSS.Model.Traffic\Conn.cs:line 59
at BSkyB.com.BSS.WCF.Traffic.Material.GetEx(List`1 materialID, List`1 versionID, List`1 mediaID, Boolean includeInactive, ConnOverride connOverride) in C:\Dev\BSkyB.com.BSS\BSkyB.com.BSS.WCF\BSkyB.com.BSS.WCF.Traffic\Material.svc.cs:line 192

The connection strings:




Note that each service has its own connection string. I have made them both identical to see if that was causing problems but it wasn't. I have also tried the default res://*/ but it made no difference. Have also tried loading the metadata manually which works but I still get the same error.

Anybody got any ideas? Both services use exactly the same model and work flawlessly unless you call them after calling the other. Both services dispose the connection as well.

tcurtis
Posts: 13
Joined: Thu 14 Jan 2010 16:52

Post by tcurtis » Fri 19 Mar 2010 14:41

Firstly, apologies for this post being posted four times - the site kept freezing.

Secondly, unfortunately you can't read my problem properly because the site isn't displaying it properly and it will not let me edit it. Great!

Just to re-iterate. I have two services using the same model. Both services are in the same project with the model in a class library in the
same solution. When I call just one service it works fine. If I call ServiceA
followed by ServiceB or the other way around then the second service always fails with:

The 'Devart.Data.Oracle.OracleProviderFactory' provider from the specified SSDL artifact(s) does not match the expected 'Devart.Data.Oracle' provider from the connection string

They are both using exactly the same connection string. This seems
like a bug to me. Any ideas?

tcurtis
Posts: 13
Joined: Thu 14 Jan 2010 16:52

Post by tcurtis » Fri 19 Mar 2010 14:44

If anybody wants to read my posts properly, then I suggest you
cut and paste them into notepad where they won't get cut off.
Cheers.

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

Post by Shalex » Tue 23 Mar 2010 13:47

We have answered you by e-mail.

Post Reply