TDataSetProvider.Options := [poFetchBlobsOnDemand]

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
Tavo
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 03.02.2010, 19:11
Contact:

TDataSetProvider.Options := [poFetchBlobsOnDemand]

Post by Tavo »

Hi! I'm using MSSQServer+Zeos+TDataSetProvider+TClientDataSet to obtain data in Master-Detail mode.
All works fine but I would like load all related rows except blobs fields and use any function for retrieve it in ClientDataSet opened.

When I set poFetchBlobsOnDemand = true the effect is the same. I think that ClientDataSet is retrieving all blobs files because the SQL execute is slow too. If I run a trace on the server, I see that blob fields are included in "Select".

How could I do it? Is the combination Zeos/MSSQServer does not work?
What i'm doing wrong? Maybe I just is missing some detail. I would greatly appreciate to give me a clue

regards
Tavo
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

I'm not sure if poFetchBlobsOnDemand should prevent the dataset to fecth the BLOBs or if it only influences the way BLOB's are exchanged between Tprovider and TClientDataset
From the documentation in Delphi on poFetchBlobsOnDemand I read:
BLOB fields are not included in data packets. Instead, client applications must request these values on an as-needed basis. If the client dataset's FetchOnDemand property is true, the client requests these values automatically. Otherwise, the client application uses the FetchBlobs method to retrieve BLOB data.
This seems to refer only to network communication between the client application and the application server. Not to the dataset workings inside the application server.
Pushing this to the level of database communication in a db protocol agnostic way would be a hell of a job, as not every database API allows for fetching BLOBs just using a pointer at the moment you need them.

To solve your problem I think you you should think about using a separate dataset to fetch the blobs you need on demand. This will cause more connections between your database and you appserver, but only retrieves the data you want to send to the server. With BLOBs this might make a terrible difference.

Mark
Image
Tavo
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 03.02.2010, 19:11
Contact:

Post by Tavo »

Short and concise, excellent. I had already read the same paragraph from the help but I was misunderstanding it because my application have two tiers and I thought only in 2 tiers.
You're right. Thank you very much.
Post Reply