0
votes

I searched a lot trying to find why am I getting this error but no help, can you please advise.

I am getting the following error when executing a linq query

    var test = (Linq query).ToList<Testdata>();

System.Data.EntityException: An error occurred while closing the provider connection. See the inner exception for details. ---> Devart.Data.Oracle.OracleException: OCI invalid handle.

at Devart.Data.Oracle.a1.c(Int32 A_0) at Devart.Data.Oracle.aq.d()

at Devart.Data.Oracle.OracleInternalConnection.a(Boolean A_0)

at Devart.Common.DbConnectionInternal.CloseInternalConnection()

at Devart.Data.Oracle.OracleInternalConnection.CloseInternalConnection()

at Devart.Common.DbConnectionInternal.Close()

at Devart.Data.Oracle.OracleInternalConnection.Close()

at Devart.Common.DbConnectionBase.Close()

at Devart.Data.Oracle.OracleConnection.Close()

at System.Data.EntityClient.EntityConnection.StoreCloseHelper() --- End of inner exception stack trace ---

at System.Data.EntityClient.EntityConnection.StoreCloseHelper()

at System.Data.EntityClient.EntityConnection.CloseHelper()

at System.Data.EntityClient.EntityConnection.Close()

at System.Data.Objects.ObjectContext.ReleaseConnection()

at System.Data.Common.Internal.Materialization.Shaper`1.Finally()

at ystem.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.Dispose()

at System.Collections.Generic.List1..ctor(IEnumerable1 collection)

at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

2
What is the value set to query? - Chetan
Sorry I don't understand your question - Mocas
Can you share some more code? What is (Linq query)? How are you getting the it? Are you getting exception on this line of code? How do you initialize the dbContext? - Chetan
Unfortunately, due to work policy, I can't share the code. Do you think the problem is due to the query itself then? - Mocas
One reason I can think of is the dbContext is already disposed when you create query. And ToList is trying to use it. - Chetan

2 Answers

1
votes

Please send us a small test project and DDL/DML script for reproducing the issue in our environment. Also specify the versions of your Oracle Server and Oracle Client.

0
votes

Issue was due to pool reaching max capacity