Page 1 of 1

OCI-21710 in TOraQueue

Posted: Tue 09 Feb 2016 15:21
by dimon_adv
Oracle 11r2 have queue with object type payload.
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: аргумент должен содержать правильный адрес объекта в памяти.
and after close application:

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 for reproduce:

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;
Error raised on second call ID := OraQueue1.Dequeue(vObj);
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;
i receive some error:
OCI-21710

Why ?

Re: OCI-21710 in TOraQueue

Posted: Fri 12 Feb 2016 06:26
by dimon_adv
Tech support is simply amazing speed, so many answers that did not even have time to read the answers ...

Re: OCI-21710 in TOraQueue

Posted: Fri 12 Feb 2016 13:16
by MaximG
Thank you for the information. We have reproduced the issue, and we will inform you about the results shortly.

Re: OCI-21710 in TOraQueue

Posted: Mon 15 Feb 2016 09:06
by MaximG
We have fixed the bug with ORA-21710 on using TOraQueue. The fix will be included in the next build.

Re: OCI-21710 in TOraQueue

Posted: Mon 15 Feb 2016 09:18
by dimon_adv
Is there some workaround?
Can I request a change the source code to correct the error (license includes source code)?
If not, when can we expect a new version?

Re: OCI-21710 in TOraQueue

Posted: Mon 15 Feb 2016 14:52
by MaximG
Please send your e-mail address and license number to maximg*devart*com

Re: OCI-21710 in TOraQueue

Posted: Wed 17 Feb 2016 12:29
by dimon_adv
I sent the information by email.

Re: OCI-21710 in TOraQueue

Posted: Thu 18 Feb 2016 09:31
by MaximG
A link to download was sent to your email address

Re: OCI-21710 in TOraQueue

Posted: Thu 25 Feb 2016 07:48
by dimon_adv
In sended build Queue work ok, but stored procedure have similar problem.

Code: Select all

  
  OraSession1.Connect;
  OraStoredProc1.StoredProcName := 'ProcWithObjectParam';
  OraStoredProc1.Prepare;
  DocObj := OraStoredProc1.ParamByName('p_ERDoc').AsObject;
  DocObj.AttrAsString['MYSQLID'] := '-1';
  OraSession1.Disconnect;
  OraSession1.Connect;
  OraStoredProc1.Prepare;
  DocObj := OraStoredProc1.ParamByName('p_ERDoc').AsObject;
  DocObj.AttrAsString['MYSQLID'] := '-2';
  !!!
---------------------------
Debugger Exception Notification
---------------------------
Project Project22.exe raised exception class $C0000005 with message 'access violation at 0x005cf998: read of address 0x00000018'.
---------------------------
Break   Continue   Help   
---------------------------

Re: OCI-21710 in TOraQueue

Posted: Thu 25 Feb 2016 14:04
by MaximG
We have checked ODAC using Object Types and found no issues. For further investigation, please compose a small sample demonstrating the problem and send it to us including the script creating the database objects to maximg*devart*com

Re: OCI-21710 in TOraQueue

Posted: Fri 26 Feb 2016 06:34
by dimon_adv
Its very easy

Code: Select all

create or replace type TTestObj as object
(
  StrVal varchar2(1000)
);
create or replace function TestFunc(InParam TTestObj) return varchar2 is
  FunctionResult varchar2(1000);
begin
  return(InParam.StrVal);
end TestFunc;

Delphi code
var
  OraSess: TOraSession;
  OraProc: TOraStoredProc;
  ParamObj: TOraObject;
begin
  OraSess := TOraSession.Create(nil);
  try
    OraProc := TOraStoredProc.Create(nil);
    try
      OraProc.Session := OraSess;
      OraSess.Server := 'TESTSERVER';
      OraSess.Username := 'TEST_SCHEME';
      OraSess.Password := 'test';
      OraSess.LoginPrompt := False;
      OraSess.Connected := True;
      OraProc.StoredProcName := 'TestFunc';
      OraProc.Prepare;
      ParamObj := OraProc.ParamByName('InParam').AsObject;
      ParamObj.AttrAsString['StrVal'] := 'Test';
      OraSess.Disconnect;
      OraSess.Connect;
      OraProc.Prepare;
      ParamObj := OraProc.ParamByName('InParam').AsObject;
      ParamObj.AttrAsString['StrVal'] := 'Test'; // <--access violation
    finally
      OraProc.Free;
    end;
  finally
    OraSess.Free;
  end;
end;

Re: OCI-21710 in TOraQueue

Posted: Tue 01 Mar 2016 08:15
by dimon_adv
The problem reproduced ?

Re: OCI-21710 in TOraQueue

Posted: Fri 18 Mar 2016 11:52
by MaximG
Thank you for the information. We have reproduced the problem and fixed the bug. The fix will be included in the next ODAC build. Currently, we have send you a link to email to download a night build with this fix.