context connection and error ORA-20100: System.AccessViolationException
665144Oct 14 2008 — edited Jun 16 2011
I created a .NET stored procedure by following the instructions on this web (used different proc name):
[http://www.oracle.com/technology/obe/net11gobe/stfunc/vs2.htm]
I can deploy it fine into the database but got the following error when I ran it in SQL*Plus Worksheet:
ORA-20100: System.AccessViolationException
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Oracle.DataAccess.Client.OpsCon.OpenUsingExtProcContext(IntPtr ociExtProcContext, IntPtr& opsConCtx, IntPtr& opsErrCtx, OpoConValCtx pOpoConValCtx, OpoConRefCtx& pOpoConRefCtx)*
at Oracle.DataAccess.Client.OracleConnection.OpenExtprocConnection()
at Oracle.DataAccess.Client.OracleConnection.Open()
at OracleTestProject.Class1.GetName()
ORA-06512: at "SYS.DBMS_CLR", line 243
ORA-06512: at "COMMPROD10.GETNAME", line 6
I got the following error if I ran it again:
ORA-20100: System.AccessViolationException
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Oracle.DataAccess.Client.OpsSql.ExecuteReader(IntPtr opsConCtx, IntPtr& opsErrCtx, IntPtr& opsSqlCtx, IntPtr& opsDacCtx, IntPtr& opsReaderErrCtx, IntPtr opsSubscrCtx, Int32& isSubscrRegistered, Int32 bchgNTFNExcludeRowidInfo, Int32 bQueryBasedNTFNRegistration, Int64& query_id, OpoSqlValCtx& pOpoSqlValCtx, String pCommandText, OpoDacValCtx*& pOpoDacValCtx, IntPtr[] pOpoPrmValCtx, String[] ppOpoPrmRefCtx, OpoMetValCtx*& pOpoMetValCtx, Int32 NoOfParams)*
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
at OracleTestProject.Class1.GetName()
ORA-06512: at "SYS.DBMS_CLR", line 243
ORA-06512: at "COMMPROD10.GETNAME", line 6
The error was gone if I changed the connection string "context connection=true" to regular connection string with specific Data Source;User ID;Password in the .NET stored proc. Does anyone know how to solve it?
FYI, I have installed Oracle Database 10.2.0.1.0 and then upgraded ODE.NET to 10.2.0.2.20 and then installed Oracle Database patch 10.2.0.4 on my machine.
I have also installed the latest ODP.NET 11.1.0.6.20 and Oracle Developer Tools for Visual Studio from the web:
[http://www.oracle.com/technology/software/tech/windows/odpnet/index.html]
The top most line in my GAC showed both Oracle.Database.Extensions and Oracle.DataAccess have Version= 2.102.2.20.
Thank you so much for the help!
Jenny