Error executing a stored procedure
Posted: Thu 06 Sep 2007 20:24
Hi,
I am using OraDirect 4.0 and am getting the error below whenever the ASP.Net code tries to execute a stored procedure. This only happens on one web server, which is a Win2003 with the Oracle 10.2.0.1 database installed on it. The code works well on the servers where only the Oracle Client installation. The type of the stored procedure doesn't seem to matter.
The error message is:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
OciDynamicType.nativea(HandleRef , HandleRef , HandleRef , Int32 , Int32 , Int32 , Int32 , Int32 ) +0
OciDynamicType.a(HandleRef , HandleRef , HandleRef , Int32 , Int32 , Int32 , Int32 , Int32 ) +45
CoreLab.Oracle.ah.a(Int32 A_0, bh A_1) +76
[OracleException (0x80004005): Internal exception in Oracle client occurred.]
CoreLab.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3) +1285
CoreLab.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +193
System.Data.Common.DbCommand.ExecuteReader() +9
CoreLab.Oracle.OracleCommand.ExecuteNonQuery() +26
Here is C# code for issuing the database call:
OracleParameter[] oraParms;
oraParms = new OracleParameter[3];
oraParms[0] = new OracleParameter("p_user_id", OracleDbType.Long, 10);
oraParms[0].Value = 101065;
oraParms[1] = new OracleParameter("p_object_id", OracleDbType.Long, 10);
oraParms[1].Value = 202;
oraParms[2] = new OracleParameter("p_right_cd", OracleDbType.Char);
oraParms[2].Direction = ParameterDirection.Output;
OracleCommand oraCommand = new OracleCommand();
string oraConnectString = "xxx";
OracleConnection oraConn = new OracleConnection();
oraConn.ConnectionString = oraConnectString;
oraConn.Open();
oraCommand.Connection = oraConn;
oraCommand.CommandType = CommandType.StoredProcedure;
oraCommand.Parameters.Add(oraParms[0]);
oraCommand.Parameters.Add(oraParms[1]);
oraCommand.Parameters.Add(oraParms[2]);
oraCommand.CommandText = procName;
oraCommand.ExecuteNonQuery();
string value = oraCommand.Parameters[2].Value.ToString();
Label1.Text = value;
oraConn.Close();
Appreciate your help.
Lana
I am using OraDirect 4.0 and am getting the error below whenever the ASP.Net code tries to execute a stored procedure. This only happens on one web server, which is a Win2003 with the Oracle 10.2.0.1 database installed on it. The code works well on the servers where only the Oracle Client installation. The type of the stored procedure doesn't seem to matter.
The error message is:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
OciDynamicType.nativea(HandleRef , HandleRef , HandleRef , Int32 , Int32 , Int32 , Int32 , Int32 ) +0
OciDynamicType.a(HandleRef , HandleRef , HandleRef , Int32 , Int32 , Int32 , Int32 , Int32 ) +45
CoreLab.Oracle.ah.a(Int32 A_0, bh A_1) +76
[OracleException (0x80004005): Internal exception in Oracle client occurred.]
CoreLab.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3) +1285
CoreLab.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +193
System.Data.Common.DbCommand.ExecuteReader() +9
CoreLab.Oracle.OracleCommand.ExecuteNonQuery() +26
Here is C# code for issuing the database call:
OracleParameter[] oraParms;
oraParms = new OracleParameter[3];
oraParms[0] = new OracleParameter("p_user_id", OracleDbType.Long, 10);
oraParms[0].Value = 101065;
oraParms[1] = new OracleParameter("p_object_id", OracleDbType.Long, 10);
oraParms[1].Value = 202;
oraParms[2] = new OracleParameter("p_right_cd", OracleDbType.Char);
oraParms[2].Direction = ParameterDirection.Output;
OracleCommand oraCommand = new OracleCommand();
string oraConnectString = "xxx";
OracleConnection oraConn = new OracleConnection();
oraConn.ConnectionString = oraConnectString;
oraConn.Open();
oraCommand.Connection = oraConn;
oraCommand.CommandType = CommandType.StoredProcedure;
oraCommand.Parameters.Add(oraParms[0]);
oraCommand.Parameters.Add(oraParms[1]);
oraCommand.Parameters.Add(oraParms[2]);
oraCommand.CommandText = procName;
oraCommand.ExecuteNonQuery();
string value = oraCommand.Parameters[2].Value.ToString();
Label1.Text = value;
oraConn.Close();
Appreciate your help.
Lana