Page 1 of 1

TDatasource or TMyDataSource

Posted: Mon 22 Jul 2013 22:50
by kwak
Currently i'm migrating a project from DBX to Devart MySQL components.

I use the following construction :

TMyConnection -> TMyQuery -> TDatasetProvider -> TClientdataset -> TDatasource

Is it preferable for changing TDataSource to TMyDataSource?
Is there any advantage?

I access the mysql database over internet. And i want the best performance.

Thanks in advance!

Re: TDatasource or TMyDataSource

Posted: Tue 23 Jul 2013 13:37
by DemetrionQ
Hello.

1) To increase performance, it is preferable to use TMyQuery directly with TDataSource (TMyConnection -> TMyQuery -> TDataSource), for example:

Code: Select all

  DataSource1.DataSet := MyQuery1;
  MyQuery1.Open;
2) TMyDataSource inherits functionality directly from the TDataSource component. It is designed specially to easy work in design time. The detailed information about the TMyDataSource can be found here: http://www.devart.com/mydac/docs/index. ... source.htm

3) You can read about increasing MyDAC performance in the "Increasing Performance" article:
http://www.devart.com/mydac/docs/increa ... rmance.htm

Re: TDatasource or TMyDataSource

Posted: Sun 28 Jul 2013 19:25
by kwak
OK Thx!

Re: TDatasource or TMyDataSource

Posted: Mon 29 Jul 2013 08:36
by DemetrionQ
If any other questions come up, please contact us.

Re: TDatasource or TMyDataSource

Posted: Mon 29 Jul 2013 14:32
by RNOVAK
I generally prefer

TMyConnection -> TMyQuery -> TDatasetProvider -> TClientdataset -> TDatasource
(TMYQuery always uniDirectional this way)

because I can change (TMyConnection -> TMyQuery) and dont need to modify (TDatasetProvider -> TClientdataset -> TDatasource) in code

because too, compatibility to access difeerent databases through different tecnologies (DBGo, DbExpress...) or because working 3 tiers

I use this form too to work with transactions, you can use:
..StartTransaction
myDataSetProvider.ApplyUpdates(myclientDataSet.Delta, 0, TransactionErrorCount);
... (not directly query or clientdataset.Aplly, but trhough DataSetProvider)
other dataSetProviders.ApplyAUdates...
... commit or rollback happens
...
so only if commit OK to all dataSetrProviders.ApplyUpdates I do myclientDataSets.MergeChangeLog
otherwise I maintain the original change log on ClientDataSets because rollback all

If I do directly myQuery.ApplyUpdates I cant keep change log this way.

I think
if I need transactions to multiple clientDataSets at the same time,
or if I need change tecnology in code
is better to me
TMyConnection -> TMyQuery -> TDatasetProvider -> TClientdataset -> TDatasource

If I need only access MySQL and I dont need transactions or ChangeLogs so the performance of TMyConnection -> TMyQuery -> TMyDataSource is better.


Roberto

Re: TDatasource or TMyDataSource

Posted: Sun 04 Aug 2013 12:59
by kwak
Thx Roberto!