Page 1 of 1
using fetch all = false
Posted: Wed 18 Apr 2007 13:18
by digdagdigedag
dear all,
1. it says in the doumentation of MyTable that one need to create a second connection to the MySql server when using fetch all = false.
what to do with this second connection ??? or is it enough if i just keep a second connection hanging around idly ?
2. when using fecth all = false, what exactly happens when i activate MyTable and move from record to record with Next() ? will the program load only those records into memory which are needed and unload as soon as they are not within scope of my cursor ?
3. does anybody have a small example application which is using fetch all = false ?
thanks
uwe
Re: using fetch all = false
Posted: Thu 19 Apr 2007 10:02
by Antaeus
uwe wrote:
1. it says in the doumentation of MyTable that one need to create a second connection to the MySql server when using fetch all = false.
what to do with this second connection ??? or is it enough if i just keep a second connection hanging around idly ?
uwe
You should do nothing with the second connection. MyDAC manages it itself. MyDAC Dataset initiates creating this connection on opening in FetchAll=False mode, uses it to fetch records asynchronous, closes it when all records are fetched.
uwe wrote:
2. when using fecth all = false, what exactly happens when i activate MyTable and move from record to record with Next() ? will the program load only those records into memory which are needed and unload as soon as they are not within scope of my cursor ?
uwe
When you open a dataset in FetchAll=False mode, it fetches several records (use the FetchRows property to specify records count to fetch in one fetch operation). If you try to browse records that are not already cached, TMyQuery fetches on more batch of records, etc.
uwe wrote:
3. does anybody have a small example application which is using fetch all = false ?
uwe
Take a look at the Query demo that is a part of MyDACDemo.
Posted: Thu 19 Apr 2007 22:37
by digdagdigedag
Take a look at the Query demo that is a part of MyDACDemo.
i checked all Apps of MyDacDemo but could not find anyone using FetchAll = false
should i simply place a second TMyConnection component, clone all the properties from the first one, activate and leave it running without connecting it to any other component ?
thanks
uwe
Posted: Fri 20 Apr 2007 15:41
by Antaeus
uwe wrote:i checked all Apps of MyDacDemo but could not find anyone using FetchAll = false
There is the check box that manages FetchAll mode for the query in the Query demo. If this check box is unchecked, MyQuery works in FetchAll=False mode.
uwe wrote:should i simply place a second TMyConnection component, clone all the properties from the first one, activate and
leave it running without connecting it to any other component ?
No, you should do nothing. This is done by MyDAC automatically.