In simple application (for demo) all components created in design time, dequeue message work fine if session established only once. If I will break the session and back сonnected then application raise next error:
Code: Select all
OCI-21710: аргумент должен содержать правильный адрес объекта в памяти.
Code: Select all
Exception EAssertionFailed in module Project22.exe at 000F48B3.
TOraType.Free RefCount = 0 (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, line 8298).
Code: Select all
procedure TForm22.Button1Click(Sender: TObject);
var
vObj: TOraObject;
ID: string;
begin
OraSession1.Connect;
OraQueue1.DequeueOptions.Navigation := qnFirstMessage;
vObj := TOraObject.Create();
try
ID := OraQueue1.Dequeue(vObj);
finally
vObj.Free;
end;
OraSession1.Disconnect;
OraSession1.Connect;
OraQueue1.DequeueOptions.Navigation := qnFirstMessage;
vObj := TOraObject.Create();
try
ID := OraQueue1.Dequeue(vObj);
finally
vObj.Free;
end;
end;
Odac 9.6.21
Delphi 2010
What correct way to initialize object before dequeue message ?
If i manual init object type like as:
Code: Select all
OraSession1.Connect;
OraQueue1.DequeueOptions.Navigation := qnFirstMessage;
vObj := TOraObject.Create();
try
vObj.AllocObject(OraSession1.OCISvcCtx, 'AQADMIN.TQPL_DOCFOREA');
ID := OraQueue1.Dequeue(vObj);
finally
vObj.Free;
end;
OraSession1.Disconnect;
OraSession1.Connect;
OraQueue1.Session := OraSession1;
OraQueue1.DequeueOptions.Navigation := qnFirstMessage;
vObj := TOraObject.Create();
try
vObj.AllocObject(OraSession1.OCISvcCtx, 'AQADMIN.TQPL_DOCFOREA');
ID := OraQueue1.Dequeue(vObj);
finally
vObj.Free;
end;
OCI-21710
Why ?