Print Thread
TLobLocator: Invalid Handle when TLobLocater.Free
#9484 08/28/07 08:53 AM
Joined: Sep 2004
Posts: 46
P
Member
OP Offline
Member
P
Joined: Sep 2004
Posts: 46
When TLobLocator.IsNull is true, TLobLocator.Free method raises Invalid Handle error.

Sample code is below

while True do
begin
Lob := FDbmsMetadata.FetchClob(Handle);
try
if Lob.IsNull then
Break;
//
finally
// Lob.Clear;
Lob.Free;
end;
end;

// DBMS_METADATA.FETCH_CLOB
function TDbmsMetadata.FetchClob(const AHandle: Variant): TLOBLocator;
begin
Result := TLOBLocator.CreateTemporary(Session, otCLOB, True);
try
GetQuery;
OCPQuery.DeclareVariable('function_result', otCLOB);
OCPQuery.SetComplexVariable('function_result', Result);
OCPQuery.DeclareVariable('HANDLE', otFloat);
OCPQuery.SetVariable('HANDLE', AHandle);
OCPQuery.SQL.Add('begin');
OCPQuery.SQL.Add(' :function_result := "DBMS_METADATA"."FETCH_CLOB"(');
OCPQuery.SQL.Add(' HANDLE => :HANDLE);');
OCPQuery.SQL.Add('end;');
OCPQuery.Execute;
except
Result.Free;
raise;
end;
end;

By invoking TLobLocator.Clear method before invoking TLobLocater.Free, I can avoid this error.
I always need to invoke Clear method before Free method??

DOA 4.0.7.1
Delphi 2005
Oracle 10.2.0.1.0

Re: TLobLocator: Invalid Handle when TLobLocater.Free
#9485 08/28/07 11:11 PM
Joined: Aug 1999
Posts: 22,219
Member
Offline
Member
Joined: Aug 1999
Posts: 22,219
[quote]I always need to invoke Clear method before Free method??[/quote]Shouldn't be necessary. The handle of the TLOBLocator is cerated when the TLOBLocator is created, and should be freed again when the instance is freed.

What is your exact Oracle Client version?


Marco Kalter
Allround Automations
Re: TLobLocator: Invalid Handle when TLobLocater.Free
#9486 08/30/07 02:42 PM
Joined: Sep 2004
Posts: 46
P
Member
OP Offline
Member
P
Joined: Sep 2004
Posts: 46
umm where to check it??

the file version of oci.dll is 10.2.0.1

Re: TLobLocator: Invalid Handle when TLobLocater.Free
#9487 09/13/07 11:53 AM
Joined: Sep 2004
Posts: 46
P
Member
OP Offline
Member
P
Joined: Sep 2004
Posts: 46
Hows this going on???????????????????????????????????????????

Re: TLobLocator: Invalid Handle when TLobLocater.Free
#9488 09/13/07 06:15 PM
Joined: Aug 1999
Posts: 22,219
Member
Offline
Member
Joined: Aug 1999
Posts: 22,219
I think I missed your previous post. Perhaps you can upgrade your 10.2.0.1 client to 10.2.0.3?


Marco Kalter
Allround Automations
Re: TLobLocator: Invalid Handle when TLobLocater.Free
#9489 09/19/07 03:16 PM
Joined: Sep 2004
Posts: 46
P
Member
OP Offline
Member
P
Joined: Sep 2004
Posts: 46
oh. this is oracle version issue?
anway, its ok with me because i can avoid this issue by invoking TLobLocator.Clear method.
I just wanteted know whether what causes this error.

pls look at this thread ttp://www.allroundautomations.com/ubb/ultimatebb.php?ubb=get_topic;f=1;t=002736
he is using Oracle 9i. so i dont think this is oracle bug.so if u have internal bug tracking system. pls add this to it to fix in furute relase.

Re: TLobLocator: Invalid Handle when TLobLocater.Free
#9490 09/19/07 10:22 PM
Joined: Aug 1999
Posts: 22,219
Member
Offline
Member
Joined: Aug 1999
Posts: 22,219
I think this may indeed be a 10.2 bug, but we'll check it out.


Marco Kalter
Allround Automations
Re: TLobLocator: Invalid Handle when TLobLocater.Free
Marco Kalter #53498 05/02/16 08:52 AM
Joined: Jun 2005
Posts: 37
Norway
A
Member
Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
I get the same problem with Oracle 12.
Is it really an Oracle bug that surface in Oracle 12 again?



Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.030s Queries: 15 (0.006s) Memory: 2.5263 MB (Peak: 3.0405 MB) Data Comp: Off Server Time: 2024-05-15 10:59:47 UTC
Valid HTML 5 and Valid CSS