I noticed that in previous versions of ODAC (9.1.4 for example) this happened very randomly, while in the latest release is quite frequent.
This happens only when I use object tables.
create an object type and a table:
Code: Select all
create or replace type obj1 as object
(
a_id number(18),
member procedure f_delete
);
create table table1 of obj1;
create or replace type body obj1 as
member procedure f_delete is
begin
delete from table1 x where x.a_id = self.a_id;
end;
end;
insert into table1 values(1);
insert into table1 values(2);
insert into table1 values(3);
insert into table1 values(4);
insert into table1 values(5);
Unit1.dfm
Code: Select all
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 279
ClientWidth = 373
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object DBGrid1: TDBGrid
Left = 8
Top = 8
Width = 281
Height = 265
DataSource = OraDataSource1
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
end
object Button1: TButton
Left = 295
Top = 39
Width = 75
Height = 25
Caption = 'Delete'
TabOrder = 1
OnClick = Button1Click
end
object Button2: TButton
Left = 295
Top = 8
Width = 75
Height = 25
Caption = 'Connect'
TabOrder = 2
OnClick = Button2Click
end
object Button3: TButton
Left = 295
Top = 70
Width = 75
Height = 25
Caption = 'Refresh'
TabOrder = 3
OnClick = Button3Click
end
object OraQuery1: TOraQuery
SQLDelete.Strings = (
'declare'
'ob1 obj1;'
'begin'
'ob1:=:obj;'
'ob1.f_delete;'
'end;')
SQL.Strings = (
'select value(x) obj from table1 x')
AutoCommit = False
ObjectView = True
Left = 280
Top = 112
end
object OraDataSource1: TOraDataSource
DataSet = OraQuery1
Left = 208
Top = 184
end
object OraSession1: TOraSession
AutoCommit = False
Left = 208
Top = 112
end
end
Code: Select all
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "DBAccess.hpp"
#include "MemDS.hpp"
#include "Ora.hpp"
#include "OraCall.hpp"
#include <Data.DB.hpp>
#include <Vcl.DBGrids.hpp>
#include <Vcl.Grids.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TOraQuery *OraQuery1;
TDBGrid *DBGrid1;
TButton *Button1;
TOraDataSource *OraDataSource1;
TOraSession *OraSession1;
TButton *Button2;
TButton *Button3;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Code: Select all
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "DBAccess"
#pragma link "MemDS"
#pragma link "Ora"
#pragma link "OraCall"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
OraQuery1->Delete();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
if(!OraSession1->Connected)
{
OraSession1->Username=L"user";
OraSession1->Password=L"pass";
OraSession1->Server=L"server";
OraSession1->Connect();
OraQuery1->Open();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
OraQuery1->Refresh();
}
//---------------------------------------------------------------------------
The message I get is:
Code: Select all
---------------------------
Bugrefresh
---------------------------
Access violation at address 0068F361 in module 'dac180.bpl'. Read of address FFFFFFFC.
---------------------------
OK
---------------------------