TDatasource or TMyDataSource

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kwak
Posts: 7
Joined: Tue 01 Jan 2013 09:25

TDatasource or TMyDataSource

Post by kwak » Mon 22 Jul 2013 22:50

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!

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: TDatasource or TMyDataSource

Post by DemetrionQ » Tue 23 Jul 2013 13:37

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

kwak
Posts: 7
Joined: Tue 01 Jan 2013 09:25

Re: TDatasource or TMyDataSource

Post by kwak » Sun 28 Jul 2013 19:25

OK Thx!

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: TDatasource or TMyDataSource

Post by DemetrionQ » Mon 29 Jul 2013 08:36

If any other questions come up, please contact us.

RNOVAK
Posts: 26
Joined: Sat 19 Feb 2011 18:30
Contact:

Re: TDatasource or TMyDataSource

Post by RNOVAK » Mon 29 Jul 2013 14:32

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

kwak
Posts: 7
Joined: Tue 01 Jan 2013 09:25

Re: TDatasource or TMyDataSource

Post by kwak » Sun 04 Aug 2013 12:59

Thx Roberto!

Post Reply