Error Using Object.Pin

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Error Using Object.Pin

Post by Aufhauser » Wed 06 Jul 2011 06:51

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 06 Jul 2011 08:33

Hello,

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

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

ObjectCache free objects

Post by Aufhauser » Fri 08 Jul 2011 07:56

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 12 Jul 2011 11:20

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.

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Post by Aufhauser » Tue 19 Jul 2011 14:18

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 20 Jul 2011 12:16

Hello,

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 07 Sep 2011 13:12

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.

smaver
Posts: 1
Joined: Mon 15 Aug 2011 08:22

Post by smaver » Thu 15 Sep 2011 00:44

Been strugling with these for weeks until I found these post. All I can say is THXS.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 15 Sep 2011 10:12

Hello smaver,

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

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Re: Error Using Object.Pin

Post by Aufhauser » Fri 17 Aug 2012 10:30

Hello Alex,

any news?

Stefan

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Re: Error Using Object.Pin

Post by Aufhauser » Mon 11 Mar 2013 11:01

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

Aufhauser
Posts: 56
Joined: Mon 21 Nov 2005 09:44
Location: Herzogenburg, Austria

Error Using Object.Pin

Post by Aufhauser » Wed 17 Jul 2013 07:14

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error Using Object.Pin

Post by AlexP » Wed 17 Jul 2013 11:41

hello,

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

Post Reply