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!
TDatasource or TMyDataSource
-
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TDatasource or TMyDataSource
Hello.
1) To increase performance, it is preferable to use TMyQuery directly with TDataSource (TMyConnection -> TMyQuery -> TDataSource), for example:
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
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;
3) You can read about increasing MyDAC performance in the "Increasing Performance" article:
http://www.devart.com/mydac/docs/increa ... rmance.htm
-
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TDatasource or TMyDataSource
If any other questions come up, please contact us.
Re: TDatasource or TMyDataSource
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
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