I am encountering a recurring issue in my application involving Oracle Data Provider for .NET (ODP.NET) when connecting to an Oracle 19c database. The application throws a System.AccessViolationException with the message: “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” The exception details are as follows:
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Oracle.DataAccess.Client.OpsCon.UnRegisterCallbacks(IntPtr& opsConCtx, IntPtr& opsErrCtx, OpoConValCtx*& pOpoConValCtx, OpoConRefCtx& pOpoConRefCtx)
at Oracle.DataAccess.Client.CallbackHashCtx.Finalize()
Environment: windows Visual Studio 2019 Oracle 19c Oracle Data Provider for .NET (ODP.NET) Unmanaged 4.122.19.1 .NET Framework 4.0
Description: The application successfully executes the business logic but intermittently crashes with the above error. This occurs in approximately 3 out of 100 executions.
Need solution for this Exception
Arun Raju ArrK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.