FreeTemporary bug?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
parksj
Posts: 8
Joined: Thu 29 Apr 2010 06:49

FreeTemporary bug?

Post by parksj » Sat 15 May 2010 08:40

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?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 17 May 2010 14:12

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.

parksj
Posts: 8
Joined: Thu 29 Apr 2010 06:49

the query result was the same

Post by parksj » Tue 18 May 2010 02:28

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?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 18 May 2010 09:29

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.

parksj
Posts: 8
Joined: Thu 29 Apr 2010 06:49

Answer Thank you.

Post by parksj » Tue 18 May 2010 13:38

Answer Thank you.

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

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 18 May 2010 14:13

We will notify you as soon as this bug is fixed.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 20 May 2010 13:00

Bug is fixed. This fix will be included in the next ODAC build.

Post Reply