TOraLoader Error

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

TOraLoader Error

Post by jdredd » Mon 13 May 2013 18:46

Using Delphi 7
Version of ODAC is 7.0.0.3

Application is processing about 160,000 small blobs (4-8k each) into a simple table.
This seems to happen once its finished.

Exception EAssertionFailed in module imguu.exe at 001369F0.
TOraLob.Free RefCount = 0 (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, line 8006).

I got the 8.0.2 update, and same error about the MemData ... Any ideas?

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

Re: TOraLoader Error

Post by AlexP » Tue 14 May 2013 09:46

Hello,

You are using an obsolete ODAC version, please try to reproduce the problem on the latest trial ODAC version 9.0.1 http://www.devart.com/odac/download.html , and if the problem repeats, contact us again.

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Re: TOraLoader Error

Post by jdredd » Thu 16 May 2013 08:09

Thanks AlexP, instead of getting trial, I just had work pay for a license renewal with
source code this time around. Once I receive it, ill rerun my tests and maybe see
where the error is happening in the ODAC code, and report back.

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Re: TOraLoader Error

Post by jdredd » Fri 17 May 2013 20:39

9.0.1 with source code installed now, still getting the error.

---------------------------
Application Error
---------------------------
Exception EAssertionFailed in module Mapmate.exe at 00139AF8.
TOraLob.Free RefCount = 0 (C:\Program Files\Devart\Odac for Delphi 7\Source\MemData.pas, line 8143).
---------------------------
OK
---------------------------

It is error out in the procedure TSharedObject.Free;

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Re: TOraLoader Error

Post by jdredd » Fri 17 May 2013 21:44

After looking at where it was actually error out at and thinking about it,
I looked at our code, and found the problem, i think.

After setting the blob in the OraTable

this was being called

oratable1.Getblob('imageblob').release;

I changed it over to

oratable1.Getblob('imageblob').FreeBlob;

And no more error now.

Does this look correct?

start of loop...
..
oratable1.Edit;
oratable1.Getblob('imageblob').LoadFromFile(fn); // load file into blob
oratable1.Post;
oratable1.GetBlob('imageblob').FreeBlob; // free the blob that was loaded
..
end of loop..

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

Re: TOraLoader Error

Post by AlexP » Wed 22 May 2013 13:18

Hello,

You don't need to call the release and FreeBlob methods, since clearing will be performed on closing DataSet. If you want to reduce memory using when working with LOB fields, you should set the DeferredLobRead property to True in DataSet and use a separate parametrized query for data editing, and clear the BLOB parameter in this query

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Re: TOraLoader Error

Post by jdredd » Wed 18 Sep 2013 19:00

What if you don't close your dataset until 1,000,000+ blob posts in a row?

It appeared the freeblob call did not work fully and eventually leaks
enough to error out with memory issues.

Would you recommend to just open/close the dataset after each post?

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

Re: TOraLoader Error

Post by AlexP » Thu 19 Sep 2013 09:08

Hello,

As I wrote you earlier, to decrease memory, you should use parametrized queries in separate OraQueries to insert large amounts of data

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Re: TOraLoader Error

Post by jdredd » Wed 04 Jun 2014 15:13

Revisiting this one... its been awhile.
AlexP wrote:As I wrote you earlier, to decrease memory, you should use parametrized queries in separate OraQueries to insert large amounts of data
I am unsure what you mean exactly by this?

Instead of using a Table object, use a query object instead?

If so, what would be the proper method to string that up and get the blob into the query insert and then insure the memory usage doesn't go crazy.

Just upgraded to 9.3.9 on D7

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

Re: TOraLoader Error

Post by AlexP » Thu 05 Jun 2014 07:24

If you insert data using the methods INSERT..POST, then data is stored in an open DataSet. Therefore you get an Out of Memory error at a large volumes of data. If you insert data using the INSERT INTO .... DML queryб the data will be inserted to a table on the server and won't accumulate in the DataSet.

Post Reply