Board index » delphi » DCOM, passing variant arrays etc

DCOM, passing variant arrays etc

Hi

What are the typical techniques for efficiently
1) Creating and populating a Variant based result 'packet' for return to a
DCOM client
2) Passing back the variant array (considering that the client is a windows
machine so the 'packet' can be passed 'as is' and should not be translated
or otherwise tampered with by the system.  (Am I right in saying this?)

I ask because I've tried to write my own routine to package the result set
from a query into a Variant array and pass it back to a client via pure
DCOM.  It works, but it's slow!  Both my routine that sets up the packet, as
well as the actual passing back of the result is quite slow, especially when
a fair number of records is passed.  The thing is, that when I use a client
dataset/provider combo to do the work for me, everything happens very
efficiently (I've not had access to a proper full version of D6 Ent so I
couldn't peek at the cds/prov src code unfortunately.)

Currently testing this using D5Pro only.

Any hints would be most appreciated,

Walter Prins

 

Re:DCOM, passing variant arrays etc


Does no one have *any* wisdom, links or pointers to share with me?!?!

:-)

Quote
"Walter Prins" <wpr...@ananzi.co.za> wrote in message

news:3bdf4a36_1@dnews...
Quote
> Hi

> What are the typical techniques for efficiently
> 1) Creating and populating a Variant based result 'packet' for return to a
> DCOM client
> 2) Passing back the variant array (considering that the client is a
windows
> machine so the 'packet' can be passed 'as is' and should not be translated
> or otherwise tampered with by the system.  (Am I right in saying this?)

> I ask because I've tried to write my own routine to package the result set
> from a query into a Variant array and pass it back to a client via pure
> DCOM.  It works, but it's slow!  Both my routine that sets up the packet,
as
> well as the actual passing back of the result is quite slow, especially
when
> a fair number of records is passed.  The thing is, that when I use a
client
> dataset/provider combo to do the work for me, everything happens very
> efficiently (I've not had access to a proper full version of D6 Ent so I
> couldn't peek at the cds/prov src code unfortunately.)

> Currently testing this using D5Pro only.

> Any hints would be most appreciated,

> Walter Prins

Re:DCOM, passing variant arrays etc


For starts you've got to consider the time taken for TQuery to retreieve all
records from a database.
Do a Query.FetchAll first instead of just calling Query.Next; see possibly
speed improvements there.
Your method of gathering the data into your variant might be inefficient.
What ever the client side does with it might take a bit of time if your
putting the whole recordset back into a Dataset for example.

The difference mainly between your technique and Client Data Set is, Client
Data set works on top of a provider data transport mechanism which packets
the data across in packets of 20 or so records. Which means it doesn't load
the whole record up at once.
Your connection remains open until the CDS and requested for the last
record.

i.e You display the recordset from a CDS directly into a grid. the CDS will
work just like a TQuery and request all you need see in packets of 20. Until
you start to scroll down the grid or jump to the very end of the grid will
the CDS even have to bother with
packeting more data.

Making the CDS packet all the data at once should give you a performace
nearer to your performance..

Personally i don't use Midas and CDS so have fun.

Hope this gives you the impression of some wisdom, or at least knowing there
is some peopl out there reading messages.
The other thing is not many people read messages if it has a reply(well i
don't) cos they assume it's been/or being sorted.

Later.

Quote
"Walter Prins" <wpr...@ananzi.co.za> wrote in message

news:3bdf4a36_1@dnews...
Quote
> Hi

> What are the typical techniques for efficiently
> 1) Creating and populating a Variant based result 'packet' for return to a
> DCOM client
> 2) Passing back the variant array (considering that the client is a
windows
> machine so the 'packet' can be passed 'as is' and should not be translated
> or otherwise tampered with by the system.  (Am I right in saying this?)

> I ask because I've tried to write my own routine to package the result set
> from a query into a Variant array and pass it back to a client via pure
> DCOM.  It works, but it's slow!  Both my routine that sets up the packet,
as
> well as the actual passing back of the result is quite slow, especially
when
> a fair number of records is passed.  The thing is, that when I use a
client
> dataset/provider combo to do the work for me, everything happens very
> efficiently (I've not had access to a proper full version of D6 Ent so I
> couldn't peek at the cds/prov src code unfortunately.)

> Currently testing this using D5Pro only.

> Any hints would be most appreciated,

> Walter Prins

Other Threads