Page 1 of 1

Error Using Object.Pin

Posted: Wed 06 Jul 2011 06:51
by Aufhauser
I have problems using Object.Pin in Delphi XE and last version of ODAC. I always get the error: OCI-21560: Argument 4 is null
Do I have to set any session variable before use of Object.Pin?

Stefan

Posted: Wed 06 Jul 2011 08:33
by AlexP
Hello,

Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.

ObjectCache free objects

Posted: Fri 08 Jul 2011 07:56
by Aufhauser
Thank you for your answer, let me decsribe my problem in a more detail way:
I use SDOGEOMETRY object type with very large datasets. If I once access the geometry field values odac doesn't unpin the objects before/after moving to the next record so OCI cannot free object cache an runs out of memory.
Using Object.Unpin causes the decribed error.
After fixing the bug it would be helpfull, if you descibe the behaviour of odac with object types in a more detail way (e.g. which locks/pins are set via odac, which do I have to set in my program). OCI documentation describes the functions of OCI but not the way odac uses them.
Thanks, Stefan

Posted: Tue 12 Jul 2011 11:20
by AlexP
Hello,

ODAC doesn't call pin and unpin automatically when working with the SDOGEOMETRY type.
Please send a sample of the way you are working with the SDOGEOMETRY type to alexp*devart*com and describe how you see the memory leak after working with SDOGEOMETRY.

Posted: Tue 19 Jul 2011 14:18
by Aufhauser
Hallo Alex,
here is a code example:
[code]
var
Session: TOraSession;
Query: TOraQuery;
begin
try
Session:= TOraSession.Create(nil);
Session.Username:= 'USERNAME';
Session.Password:= 'PASSWORD';
Session.Server:= 'SERVER';
Session.Connected:= True;
//
Query:= TOraQuery.Create(nil);
Query.Session:= Session;
// Select only integer primary key of table (400 000 records)
Query.SQL.Add('Select GDO_GID from GEOTIME.NF_KF');
Query.Active:= True;
while not Query.Eof do
Begin
Query.Next;
End;
// about 6 seconds
// about 16 MB memory
Query.Active:= False;
Query.SQL.Clear;
// Select integer primary key and geometry of table (400 000 records)
Query.SQL.Add('Select GDO_GID, SDOGEOMETRY from GEOTIME.NF_KF');
Query.Active:= True;
while not Query.Eof do
Begin
Query.Next;
End;
// a few minutes
// 1 GB (!!) memory
Query.Active:= False;
Session.Connected:= False;
finally
Query.Free;
Session.Free;
// memory is still used and freed when application is closed
end;
[/code]

You see: selecting only the primary key causes no problem, selecting even the geomtry field leads to memory problems. It seems as if OADC does an object pin to force OCI to load and lock the object and does no unpin to free the cache. I think it would be the better way to set the pin after loading geometry field using
Geom:= FQuery.GetObject(FGeomFieldName)
and unpin the object when the cursor is moved.

Posted: Wed 20 Jul 2011 12:16
by AlexP
Hello,

Thank you for the information.
We have reproduced the problem. We will try to fix this behaviour in one of the future versions.

Posted: Wed 07 Sep 2011 13:12
by AlexP
Hello,

We will try to change this behavior in one of future versions.
Presently, you can either use the UniDirectional mode or read data from the Geometry fields by using a separate query when needed.

Posted: Thu 15 Sep 2011 00:44
by smaver
Been strugling with these for weeks until I found these post. All I can say is THXS.

Posted: Thu 15 Sep 2011 10:12
by AlexP
Hello smaver,

If you have any other questions, feel free to contact us.

Re: Error Using Object.Pin

Posted: Fri 17 Aug 2012 10:30
by Aufhauser
Hello Alex,

any news?

Stefan

Re: Error Using Object.Pin

Posted: Mon 11 Mar 2013 11:01
by Aufhauser
Hello,
do you have good or bad news for me?
Because of this I have great performance and memory problems using ODAC with SDO_GEOMETRY type. Other solutions are much faster than ODAC reading SDO_GEOMETRY from database.

Stefan

Error Using Object.Pin

Posted: Wed 17 Jul 2013 07:14
by Aufhauser
Hello,

in change log of new version I found:
---
Bug with object and table types in the scrollable cursors is fixed
Bug with not freeing memory allocated for array parameters on calling the Clear method is fixed
---
Do this fixes solve my memory problem?

Stefan

Re: Error Using Object.Pin

Posted: Wed 17 Jul 2013 11:41
by AlexP
hello,

Unfortunately, we have not found a solution for this problem yet.