OCI-21710 in TOraQueue

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

OCI-21710 in TOraQueue

Post by dimon_adv » Tue 09 Feb 2016 15:21

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 ?

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: OCI-21710 in TOraQueue

Post by dimon_adv » Fri 12 Feb 2016 06:26

Tech support is simply amazing speed, so many answers that did not even have time to read the answers ...

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: OCI-21710 in TOraQueue

Post by MaximG » Fri 12 Feb 2016 13:16

Thank you for the information. We have reproduced the issue, and we will inform you about the results shortly.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: OCI-21710 in TOraQueue

Post by MaximG » Mon 15 Feb 2016 09:06

We have fixed the bug with ORA-21710 on using TOraQueue. The fix will be included in the next build.

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: OCI-21710 in TOraQueue

Post by dimon_adv » Mon 15 Feb 2016 09:18

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?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: OCI-21710 in TOraQueue

Post by MaximG » Mon 15 Feb 2016 14:52

Please send your e-mail address and license number to maximg*devart*com

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: OCI-21710 in TOraQueue

Post by dimon_adv » Wed 17 Feb 2016 12:29

I sent the information by email.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: OCI-21710 in TOraQueue

Post by MaximG » Thu 18 Feb 2016 09:31

A link to download was sent to your email address

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: OCI-21710 in TOraQueue

Post by dimon_adv » Thu 25 Feb 2016 07:48

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   
---------------------------

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: OCI-21710 in TOraQueue

Post by MaximG » Thu 25 Feb 2016 14:04

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

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: OCI-21710 in TOraQueue

Post by dimon_adv » Fri 26 Feb 2016 06:34

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;

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: OCI-21710 in TOraQueue

Post by dimon_adv » Tue 01 Mar 2016 08:15

The problem reproduced ?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: OCI-21710 in TOraQueue

Post by MaximG » Fri 18 Mar 2016 11:52

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.

Post Reply