refresh data

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eug
Posts: 4
Joined: Fri 10 Jul 2009 16:48

refresh data

Post by eug » Wed 16 Sep 2009 19:16

Mydav 3.55 - Delphi 5
Mytable ART: InnoDB Cache Update = true
How can I refresh the records on other machines?
Thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 17 Sep 2009 07:22

Use the TDataSet.Refresh method.

eug
Posts: 4
Joined: Fri 10 Jul 2009 16:48

Post by eug » Thu 17 Sep 2009 07:58

Thanks for your reply.
Running Tdataset.Refresh is possible that the cache is lost?
My problem is this:
pc1-> ART.append-> id = X -> applyupdate-> commit, etc.. etc. ..
pc2-> ART.LOCATE (X) -> record not found
Thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 18 Sep 2009 07:07

If you call the Refresh method all modified cached data will be lost. To solve this problem you should save data to the database by calling the ApplyUpdates and Commit methods.

eug
Posts: 4
Joined: Fri 10 Jul 2009 16:48

Post by eug » Fri 18 Sep 2009 08:55

Thanks Dimon
Take this opportunity to ask you if you want to use the cacheupdate all transactions?
Are sufficient only transactions without cacheupdate?
Thanks again
Hello

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 18 Sep 2009 10:26

Using the cached updates mode and transactions are not connected.

Cached updates are especially useful for client applications working with remote database servers. Enabling cached updates brings up the following benefits:
- Fewer access counts to database and shorter session times.
- Minimized network traffic.

Transactions are used to commit or rollback many changes in database at a heat. Updates, insertions, and deletions that take place after a call of StartTransaction are held by the server until application calls Commit to save the changes, or Rollback to cancel them.

You can find more detailed information about this in the MyDAC help.

Post Reply