Improving Performance with Client Datasets

   

Just using a TClientDataSet can improve performance, if your performance throughput is affected by network bandwidth demands. However, you can do more.

There are a variety of options you can use to improve performance with client datasets. Some of those options are available on the TProvider component. Others appear on the TClientDataSet component.

On the TClientDataSet some of the properties that affect performance include

  • PacketRecords ” This indicates how many records should be passed across the network from the provider. The default used for this is ”1, which indicates that as many records as necessary should be passed across the network at any given time. How many records that might be, is controlled by the on demand options of the client datasets.

  • FetchOnDemand ” This is an overall constraint on how frequently records are fetched from the provider. As the user scrolls through a data-aware grid or uses some other control to conduct a search, when FetchOnDemand is true, records are obtained as needed to fill the visible area of the grid. If false, the application must explicitly fetch records as needed. False is generally not appropriate for interactive applications.

On the TProvider , there are other properties that affect performance:

  • Options ” These include poFetchBlobsOnDemand and poFetchDetailsOnDemand . If TClientDataSet 's FetchOnDemand property is true, the client will only request blobs as needed. This means that blobs will not be unnecessarily passed over the network. For instance, if you use a TDBMemo control to display text blobs, you will only be displaying a single blob at a time. Your grid might normally request 20 or 30 rows transferred to the network for a given page display, despite only needing to display one. Obviously, this option can significantly improve performance, particularly when your data set contains large blobs.

One other property can be useful in improving performance with client datasets. If your application surfaces its user interface on the Web, it might require an XML representation of its data. If that is the case, the XML data property of the TClientDataSet , can be used to provide a copy of the client dataset's local in-memory data as an XML data packet. This can save you from having to assemble the XML yourself programmatically.


   
Top


C++ Builder Developers Guide
C++Builder 5 Developers Guide
ISBN: 0672319721
EAN: 2147483647
Year: 2002
Pages: 253

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net