Error Using Object.Pin
Error Using Object.Pin
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
Do I have to set any session variable before use of Object.Pin?
Stefan
ObjectCache free objects
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
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
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.
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.
Re: Error Using Object.Pin
Hello Alex,
any news?
Stefan
any news?
Stefan
Re: Error Using Object.Pin
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
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
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
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
hello,
Unfortunately, we have not found a solution for this problem yet.
Unfortunately, we have not found a solution for this problem yet.