DOA Bug with processing of Nested LOB Collumns.

Marian

Member
Hi there,
I just want to inform you about a bug inside DOA when I try to access table with "Table of Object" Object types.

After I have checked the source code it seems that for all nested object types resulted by an TOracleQuery (select statement) the "Table" field of TOracleObject is never set and as consequence the selected object is marked as non persistent.

Because of that when I have a nested object with a Lob Attribute the program checks if the BaseObject is persistent (which is always false in this case !!!) and if not DOA will reset the LocatorHandle and set it wrong to NULL.

The consequence is the inability of my client application to access the contents of my nested records anymore.

Please advise us how to solve this problem.
Thank you, Marian

*********************************************
To test this problem just create the following objects:

CREATE OR REPLACE type MSGDATAREC as object
(
filename VARCHAR2(300),
filedata BLOB
)
/
CREATE OR REPLACE type MSGDATALIST as table of MSGDATAREC
/

CREATE TABLE "TESTDATA"
( "SUBJECT" VARCHAR2(255),
"DATA" "MSGDATALIST"
)
NESTED TABLE "DATA" STORE AS "TESTDATA$MSGS"
RETURN AS VALUE
/

then setup some test data:
DECLARE
stext VARCHAR2(32767);
atext RAW(32767);
ldata BLOB;
nidx INTEGER;
BEGIN
delete from testdata;
for nidx in 0..9 loop
stext := 'Record: ' || nidx;
atext := UTL_RAW.cast_to_raw(stext);
DBMS_LOB.CreateTemporary(ldata, TRUE);
DBMS_LOB.WriteAppend (ldata, UTL_RAW.Length(atext), atext);
insert into testdata(SUBJECT, DATA)
values(stext, MSGDATALIST(MSGDATAREC('text.txt', ldata)));
DBMS_LOB.FreeTemporary (ldata);
end loop;
commit;
END;
/

and then try to access the TESTDATA.DATA[*].FILEDATA column:

Create TOracleQuery for (select * from testdata) and try to navigate through the DATA TOracleObject column.
 
Thank you Marco.

FYI, I have sent another email to support@allround... with the source code of my demo program as well. The only thing to do is to run my database scripts and start my demo.

Marian
 
Marco, can I get in contact with your support team. I have made some research and I have updates on my problem. My email address is m.pascalau(at)fiplan.de or marian_pascalau(at)hotmail.com.

After I have checked again DOA source code I realized that the persistance state of an object is controled by two fields: Pinned (boolean) and Table (Pointer) (Pinned which locks the cache/lock object on the client and table which have a simmilar meaning but for Table objects).

I have checked again the DOA procedure TOracleQuery.InternalDescribe; For each FieldData of dbtype = otObject DOA calls OCIObjectPin (Object is Pinned) which will never get remembered later when DOA creates the correspondent TOracleObject. This means that the Pinned status will never get released by DOA when TOracleQuery will release it's objects.

Now the question: is it correct based on my assuption that "DOA forgets to mark Objects as Pinned inside TOracleQuery.InternalDescribe procedure" to add the following lines of code to your original source code?

if ObjClass = TOracleObject then
TOracleObject(Obj).Pinned := True;

line 7994:
if BufType = otObject then
begin
// Create a new instance for each cache position
GetMem(NullStructs, SizeOf(Pointer) * UsedCache);
FillChar(NullStructs^, SizeOf(Pointer) * UsedCache, 0);
if TypeName = 'SYS.XMLTYPE' then
ObjClass := TXMLType
else
ObjClass := TOracleObject;
Obj := ObjClass.New(Session, Self.MonID, Name);
TOracleObject(Obj).InstanceOwner := False;
///
if ObjClass = TOracleObject then
TOracleObject(Obj).Pinned := True;
///
end;

Thank you in advance,
Marian
 
Back
Top