Page 1 of 1

Firebird Blob

Posted: Thu 16 Oct 2014 10:05
by abed
Hello,
I set deferredBlobRead as True with a huge table imagines to accelerate the fetches,
Every things goes ok, until I did TuniQuery.last.
I’ve got an error from the TIBCBlob.AllocBlob.
Any help

Re: Firebird Blob

Posted: Thu 16 Oct 2014 11:32
by ViktorV
Unfortunately, we could not reproduce the issue.
Please specify the full error message you are getting.

Re: Firebird Blob

Posted: Thu 16 Oct 2014 13:12
by abed
I hope that's help [img]Unierr.jpg[/img]

Re: Firebird Blob

Posted: Thu 16 Oct 2014 13:14
by abed
Scuse me, how to attach an image?

Re: Firebird Blob

Posted: Thu 16 Oct 2014 14:27
by abed
Hello,
in this piece of code i create manually what tcxDBImage does and how
exception generated


procedure TfrmDip.dsDipDataChange(Sender: TObject; Field: TField);
var
Stream: TMemoryStream;

begin
//tbDip_DIP it's a TuniQuery
//SpecificOptions.Values['InterBase.DeferredBlobRead'] :='True';
//SpecificOptions.Values['CacheBlobs'] :='False';
//PHOTO IS BlobField in Firebird table

with tbDip_DIP do
begin
if Not FieldByName('PHOTO').IsNull then
begin
Stream := TMemoryStream.Create;
stream := TmemoryStream(CreateBlobStream(FieldByName('PHOTO'),bmRead));
try
stream.Size := TBlobField(FieldByName('PHOTO')).BlobSize;
except
//just when EOF
end;
stream.Position := 0;
cxImage1.Picture.Bitmap.LoadFromStream(Stream);
end;
end;
end;

Re: Firebird Blob

Posted: Fri 17 Oct 2014 08:04
by ViktorV
Since your DeferredBlobRead property is set to True, then Blob fields are fetched on demand. But when calling TUniQuery.Last, calls to all the records and fetch of Blob fields occur in the loop. This is most likely the reason for the error you get.
Take a look at the SmartFetch option, that we have implemented in the latest UniDAC version (http://www.devart.com/unidac/docs/devar ... ptions.htm).
It can be useful when navigating through large recordsets.

Re: Firebird Blob

Posted: Fri 17 Oct 2014 16:15
by abed
No, i've got other worse problems,
i've worked arround differently
i hope that next update w'll be solved.
N.B.
(i create readonly transaction on the fly).

Re: Firebird Blob

Posted: Fri 17 Oct 2014 16:17
by abed
correction
the transction was created on the fly and it's readonly,
and i think that in this way, it's part of the problem.
thanks

Re: Firebird Blob

Posted: Mon 20 Oct 2014 08:58
by ViktorV
Unfortunately, we couldn't reproduce the problem in the described way. In addition, you are using third-party components (e.g., TcxDBImage). Try to reproduce the problem having replaced the third-party components by the standard ones, and if the error is reproduced correctly, please send a small sample to viktorv*devart*com to demonstrate the issue, including a script to create database objects.

Re: Firebird Blob

Posted: Wed 22 Oct 2014 08:37
by abed
I've got the same error with Std delphi controls.
for the moment no problem, i've workedarround.
when i've some time, i'll prepare for u a separate piece of code to reproduce it.
thanks

Re: Firebird Blob

Posted: Wed 22 Oct 2014 09:17
by ViktorV
Feel free to contact us if you have any further questions.