Weird EF Connection Problem - Help!
Posted: 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.
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.