My Oracle Support Banner

RDBPROD: Delete Via RdbCommandBuilder Fails With A Memory Error (Doc ID 1566932.1)

Last updated on AUGUST 12, 2016

Applies to:

Oracle Rdb Server on OpenVMS - Version 7.3.2.0 to 7.3.2.1 [Release 7.3]
Oracle Rdb Developer Tools for Visual Studio - Version 7.3.2.0 to 7.3.2.1 [Release 7.3]
Information in this document applies to any platform.

Symptoms

The following code fails:

public void Test()
  {
  RdbDataAdapter da;
  int valueWhere =1;

  string cnxString = "Type=SQS;User Id=user;Password=pw;Server=node:GENERIC;Database=DISK$DATA:[USER]TEST.RDB;";
  RdbConnection conn = new RdbConnection(cnxString);
  try
  {
  conn.Open();

  string selectCmd = "SELECT id_value, valuef from table1 WHERE id_value = @PARAMETER1";

  RdbCommand cmd = new RdbCommand();
  cmd.CommandType = CommandType.Text;
  cmd.CommandText = selectCmd;
  cmd.Connection = conn;

  RdbParameter param = new RdbParameter("@PARAMETER1", DbType.Int32);
  param.Value = valueWhere;
  param.IsNullable = false;
  cmd.Parameters.Add(param);

  da = new RdbDataAdapter(cmd);
  DataSet ds = new DataSet();
 
  da.Fill(ds,"Table");

  ds.Tables[0].Rows[0].Delete();
  
  RdbCommandBuilder bldr = new RdbCommandBuilder(da);
  
  RdbTransaction trans = conn.BeginTransaction("READ WRITE");
  da.UpdateCommand.Transaction = trans;
  da.InsertCommand.Transaction = trans;
  da.DeleteCommand.Transaction = trans;
  da.Update(ds,"Table");
  trans.Commit();
  }
  catch (Exception ex)
  {
  MessageBox.Show(ex.Message);
  }
  }


The error message is:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.