Here's a bug for you...

Eric^2

Member²
This bug relates to accessing the properties of a nested object that is not final.

Connected to:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
JServer Release 9.0.1.1.1 - Production

SQL> create type taddress as object (
2 line1 varchar2(30),
3 line2 varchar2(30),
4 line3 varchar2(30)) not final
5 /

Type created.

SQL> create type tperson as object (
2 firstname varchar2(30),
3 lastname varchar2(30),
4 address taddress) final
5 /

Type created.

SQL> create table people of tperson
2 /

Table created.

SQL> insert into people values
2 ('Fred', 'Harvey', taddress('1234 Somewhere', null, null))
3 /

1 row created.

SQL> commit;

Commit complete.

SQL>

SQL Plus works just fine. Now connect to this schema and run the following code:

procedure TForm1.Button1Click(Sender: TObject);
var
Person, Address: TOracleObject;
begin
OracleSession1.LogOn;
Person := TOracleObject.Create(OracleSession1, 'TPerson', 'People');
Person.SetAttr('FirstName', 'Bob');
Address := Person.ObjAttr('Address');
Address.SetAttr('Line1', '5432 Nowhere Ln.');
Person.Flush; // Crashes (access violation)
OracleSession1.Commit;
OracleSession1.LogOff;
end;

And when you close the app, you get an EExternalException.

Help.
 
...and just so you can see it's a final/not final problem, do this:

SQL> alter type taddress final cascade;

Type altered.

SQL>

Try the above code again and it will work just fine.

The crash occurs in orageneric9.dll during a read of address 00000010.

Help.
 
I just completed an Oracle 9.2.0.1.0 install (the latest on Windows) and tried this again. I still get the same error. Can anyone else verify this?
 
Sorry for the delay, I meant to verify this quite some time ago. I will de so shortly.

------------------
Marco Kalter
Allround Automations
 
It turned out that there is a problem accessing attributes of an embedded object that is not final, if you are using an Oracle9 Client (I have not yet tested this on an Oracle8 Client).

If you would like to receive a patch pre-release, please contact me by e-mail.

------------------
Marco Kalter
Allround Automations
 
Back
Top