Subject Re: [ib-support] Database grows rapidly (3 to 770MB) when using BLOB views/UDFs
Author Claudio Valderrama C.
""mircostange"" <mirco@...> wrote in message
news:a747s0+8v9h@......
> Hi Everyone,
>

> The solution uses a custom UDF MakeBitmap that takes a BLOB
> containing the EMF and produces a BLOB containing the BMP. The
> declaration is as follows:
>
> DECLARE EXTERNAL FUNCTION PROPXMAKEBITMAP
> BLOB, DOUBLE PRECISION
> RETURNS BLOB
> ENTRY_POINT 'ProPXMakeBitmap' MODULE_NAME 'ProPXUDF.dll';

Is this a typical UDF or a true blob filter? IB and FB support an alien
feature named blob filters that nobody seems to be using. It allows to
convert among arbitrary user types on demand. For what I see, yours is a
plain UDF and is returning a blob.
How can you return a blob? You are reading a blob and converting it to
another format inside the udf, so you can't return the original blob to the
view and hence to the user. Are you creating a new temporary blob inside the
UDF? Maybe all the problem lies in the code inside your UDF.

> In IBConsole, I tried
> select * from sampleattachmentbmp
> which gives a result of 10 rows with the BMP images. Afterwards, I
> did a commit from the transaction menu. I am the only user, so to my
> mind there is no transaction pending.
> These steps grew the database from 3 to 180 MB!!

I think that there's something wrong in your udf, then.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing