Search code examples
c#oraclelinqdevart

An error occurred while closing the provider connection…OCI invalid handle


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)


Solution

  • Issue was due to pool reaching max capacity