Page 1 of 1

FreeTemporary bug?

Posted: Sat 15 May 2010 08:40
by parksj
A few days ago about this and wrote.

var
b: TOraLob;
begin
b: = TOraLob.Create (Session.OCISvcCtx);
b.CreateTemporary (ltBLob);
b.LoadFromFile ('C: \ TEST.TXT');
b.WriteLob;
b.FreeTemporary; -> temp is not free.
b.FreeLob;
end;

jdbc the BLOB.freeTemporary (blob); the temp is free.

ocdac 6.90 try version / delphi 7 was tested with.

Are you FreeTemporary bug?

Posted: Mon 17 May 2010 14:12
by bork
Hello

Try to execute two versions of the code:

1:

Code: Select all

  b := TOraLob.Create(OraSession1.OCISvcCtx);
  b.CreateTemporary(ltBLob);
  b.LoadFromFile('screen1.bmp ');
  b.WriteLob;
  b.FreeTemporary;
  b.FreeLob;

  b := TOraLob.Create(OraSession1.OCISvcCtx);
  b.CreateTemporary(ltBLob);
  b.LoadFromFile('screen2.bmp ');
  b.WriteLob;
  b.FreeTemporary;
  b.FreeLob;

  b := TOraLob.Create(OraSession1.OCISvcCtx);
  b.CreateTemporary(ltBLob);
  b.LoadFromFile('screen3.bmp ');
  b.WriteLob;
  b.FreeTemporary;
  b.FreeLob;
2:

Code: Select all

  b := TOraLob.Create(OraSession1.OCISvcCtx);
  b.CreateTemporary(ltBLob);
  b.LoadFromFile('screen1.bmp ');
  b.WriteLob;

  b := TOraLob.Create(OraSession1.OCISvcCtx);
  b.CreateTemporary(ltBLob);
  b.LoadFromFile('screen2.bmp ');
  b.WriteLob;

  b := TOraLob.Create(OraSession1.OCISvcCtx);
  b.CreateTemporary(ltBLob);
  b.LoadFromFile('screen3.bmp ');
  b.WriteLob;
And check the used memory in the temporary table space with the query:

Code: Select all

SELECT   A.tablespace_name tablespace, D.mb_total,
         SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
         D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM     v$sort_segment A,
         (
         SELECT   B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
         FROM     v$tablespace B, v$tempfile C
         WHERE    B.ts#= C.ts#
         GROUP BY B.name, C.block_size
         ) D
WHERE    A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total;
In the first case memory will be allocated only once and will be reused for each new picture. In the second case new memory will be allocated for each picture. So the FreeTemporary method releases the used memory with the temporary LOB.

the query result was the same

Posted: Tue 18 May 2010 02:28
by parksj
As a test of two kinds of code, but the query result was the same

Session MODE Direct is a global variable was declared.

Session: = TOraSession.Create (nil);
Session.Server: = '192 .168.253.105:1521:orcl';
Session.Username: ='test';
Session.Password: = 'test';
Session.Options.Direct: = true;
Session.Open;

Upload file to Oracle through the Full Temp sikineunde errors that kick
Appears.

Direct mode, you have a problem?

Posted: Tue 18 May 2010 09:29
by bork
In your first post you did not specify the mode you used: OCI or Direct. In the OCi mode FreeTemporary works correct. We know about the bug in the direct mode and we've been fixing it for some time. I hope it will be fixed in the next ODAC build.

Answer Thank you.

Posted: Tue 18 May 2010 13:38
by parksj
Answer Thank you.

Our project is in progress with regard to this.
Direct Mode is a patch about when you let me know.

Posted: Tue 18 May 2010 14:13
by bork
We will notify you as soon as this bug is fixed.

Posted: Thu 20 May 2010 13:00
by bork
Bug is fixed. This fix will be included in the next ODAC build.