Is there a drawback on having multiple datastreamers

since dabin2streamer isn’t thread safe (afaik), and more data oriented tasks are done in threads, i’m considering giving every datamodule or derived table object it’s own datastreamer, so nothing will hinder something else…

is there a drawback for creating for example 100’s dabin2streamers at once?

same goes for service and channel…?

Hi,

if you launch each request in personal thread you should have personal streamer for each thread.


By other hand, you can play with RDA. it can use internal TDABin2DataStreamer.
also in direct access mode, you can specify TargetURL and it will autocreate required channel and internal RemoteService so you need to create only RDA.

yes i saw that looking at the code, that’s why i guess that creating multiple streamers does not affect things.. and the internal streamer is always created by RDA afaik

the reason for using explicit streamer is buffersize and reduceddelta…

not having to reassign a streamer for each thread simplifies things…

Hi,

You can change properties of internal bin2 streamer in runtime, like

RDA.DataStreamer.BufferSize := 262144 * 2;
RDA.DataStreamer.SendReducedDelta:= True;

yes i know :slight_smile:

256kb is a bit on the low end :slight_smile:

Hi,

by other hand, it has no a reason to allocate 10 MB for a table with 10 rows.

ok… so the buffer is always allocated in full?

and if the size of the sql request exceeds the standard 256kb is that buffer size still a hard limit? (didn’t check the source)

Hi,

it’s like TMemoryStream.Capacity

i guess i’m confusing buffersize with maxpackagesize

had a quick look, so correct me if i’m wrong but the buffer is adapting itself to the size needed to read the returned dataset…in that case there is no real need to have a big buffersize for most use cases

yes, you are right