Bug: Access violation OraXML field / Unicode

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heidenbluth
Posts: 56
Joined: Mon 08 Nov 2004 19:01
Location: Germany

Bug: Access violation OraXML field / Unicode

Post by heidenbluth » Sun 29 Aug 2021 18:43

We use
- Oracle 19c local installation (both SQL*Net and database)
- Windows 10 64 Bit
- Delphi 10.4.2
- ODAC11.4.4

Please create the sample table

Code: Select all

CREATE TABLE EMPLOYEES
(
  ID NUMBER,
  DATA XMLTYPE
)
and insert data

Code: Select all

INSERT INTO EMPLOYEES
     VALUES (1, xmltype ('<Employees>
    <Employee emplid="1111" type="admin">
        <firstname>John</firstname>
        <lastname>Watson</lastname>
        <age>30</age>
        <email>[email protected]</email>
    </Employee>
    <Employee emplid="2222" type="admin">
        <firstname>Sherlock</firstname>
        <lastname>Homes</lastname>
        <age>32</age>
        <email>[email protected]</email>
    </Employee>
    <Employee emplid="3333" type="user">
        <firstname>Jim</firstname>
        <lastname>Moriarty</lastname>
        <age>52</age>
        <email>[email protected]</email>
    </Employee>
    <Employee emplid="4444" type="user">
        <firstname>Mycroft</firstname>
        <lastname>Holmes</lastname>
        <age>41</age>
        <email>[email protected]</email>
    </Employee>
</Employees>'));
Run Delphi, and
- Create a new application and change to 64 Bit
- Place a TOraSession component on the form. Use a SQL*Net connection
- Enable Unicode:
Session.Options.UseUnicode := True;
FSession.Options.UnicodeEnvironment := True;

- Place a TSmartQuery on the form, set SQL to "Select * from employees"
- Connect via TOraDatasource to a data grid
- Place a button on the form to open the query

You will get an access violation error in TOraXML.Read line 4477: Check(OCI8.OCIPStreamRead(...));

The exception does only occur with SQL*Net and when Unicode is enabled.

Could you please provide a fix ASAP?

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

Re: Bug: Access violation OraXML field / Unicode

Post by MaximG » Tue 31 Aug 2021 10:43

Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.

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

Re: Bug: Access violation OraXML field / Unicode

Post by MaximG » Fri 03 Sep 2021 10:14

We've reproduced the issue and fixed it. The fix will be included in the next build of our product. As a workaround, we can send you a night ODAC build including the required changes.
For this provide us with your license number and IDE version you are interested in For your convenience, please use the e-support form https://www.devart.com/company/contactform.html

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

Re: Bug: Access violation OraXML field / Unicode

Post by MaximG » Thu 07 Oct 2021 08:22

We released a new version of ODAC that contains the fix. You can download it on our website.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Bug: Access violation OraXML field / Unicode

Post by jdorlon » Tue 19 Oct 2021 21:30

Hi Maxim,

I have discovered that XMLTYPE is only fixed if the Oracle Client version is 12.2 or newer.

Is it possible for it to be fixed with the older client versions?

Thanks

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

Re: Bug: Access violation OraXML field / Unicode

Post by MaximG » Fri 22 Oct 2021 16:14

Hi!

Thanks for the reply! The fixes for XMLTYPE operation are independent of any specific Oracle version.
Using the internal auto tests, we checked the correctness of the changes made for all supported versions of Oracle.
Could you please specify in which version of Oracle the "access violation error in TOraXML.Read" error occurs when executing your test project?

Looking forward to your reply.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Bug: Access violation OraXML field / Unicode

Post by jdorlon » Fri 22 Oct 2021 16:31

Sorry, I should have specified.

I don't get an access violation, I get ORA-30757: cannot access type information

I just tried to make a demo app and I don't get error. It happens only in our application.

I'll post again if I can provide a demo, but please let me know if you have any ideas of why we are getting ORA-30757.

Thanks.

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

Re: Bug: Access violation OraXML field / Unicode

Post by MaximG » Tue 26 Oct 2021 11:52

Kindly be informed that we have not received any message from our users about the occurrence of the ORA-30757 error in such conditions. Also, please note that we could not find this error using our internal autotests. Therefore, to investigate the problem we need a simple example which while executing we are getting this error.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Bug: Access violation OraXML field / Unicode

Post by jdorlon » Thu 28 Oct 2021 18:37

Ok, here is some more info:

when I create my own table with some small XML samples, I don't get any error.

However, When I run "SELECT * FROM DBA_XML_SCHEMAS", I get the ORA-30757 when Oracle client version is 12.1 or older.

This is just a standard 19c database. I have not created any XML Schemas, but there are 44 rows in that view.

My code is very simple.
Unit1.pas:

Code: Select all

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, MemDS,
  DBAccess, Ora, OraSmart, OraCall;

type
  TForm1 = class(TForm)
    OraSession1: TOraSession;
    SmartQuery1: TSmartQuery;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  OraCall.OCIUnicode := True;
  OraSession1.Connected := True;
  SmartQuery1.Execute;
end;

end.
Unit1.dfm:

Code: Select all

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 177
  ClientWidth = 271
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object OraSession1: TOraSession
    Options.UseUnicode = True
    Options.EnableNumbers = True
    Options.UnicodeEnvironment = True
    Username = 'jdorlon'
    Server = 'azure_19c_plug'
    AutoCommit = False
    Connected = True
    LoginPrompt = False
    HomeName = 'InstantClient1'
    Left = 120
    Top = 32
    EncryptedPassword = '95FF9BFF90FF8DFF93FF90FF91FF'
  end
  object SmartQuery1: TSmartQuery
    Session = OraSession1
    SQL.Strings = (
      'select * from dba_xml_schemas')
    Options.StrictUpdate = False
    Options.SetFieldsReadOnly = False
    Options.ExtendedFieldsInfo = False
    ObjectView = True
    Left = 40
    Top = 32
  end
end

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Bug: Access violation OraXML field / Unicode

Post by jdorlon » Tue 04 Jan 2022 21:24

Hello,

Can you reproduce this problem with my sample project in my prior reply?

Thank you.

Post Reply