Page 1 of 1
TMyquery.FieldDefs.Update create new connection : how to solve this bug ?
Posted: Wed 28 Sep 2005 14:06
by swierzbicki
Hi Ikar,
Have you look to this problem ?
When calling the TMyquery.FieldDefs.Update method, a new connection is created. It seems that the TMyquery.Connection isn't used.
Thank you.
Posted: Wed 28 Sep 2005 15:10
by Ikar
Yes, this behavior was made for performance reason. If the statement returns large amount of data, creating and killing new connection is faster, than fetch all data from server.
Posted: Wed 28 Sep 2005 15:58
by swierzbicki
I can understand that a new connection is made but :
Why killing the current (unique) active connection ???
This lead to :
- loose all temporary tables
- loose all my user variable
These things are connection based ! IMPOV this isn't a reliable solution
If the statement returns large amount of data
how large do you expect this ? Doing an update fieldef doesn't retreive megabits !!! Really, I don't understand that
Posted: Wed 28 Sep 2005 16:10
by GEswin
Mainly problem is that FieldDefs.Update won't work with TEMPORARY tables, on new connection it won't find that table, since they are Connection based.
Solution is to use the same connection of the query. Btw why should it load huge amounts of data ? Mainly it should only get field structures.
regards
Posted: Thu 29 Sep 2005 08:06
by Ikar
> Why killing the current (unique) active connection ???
Current connection remains active. MyDAC create new connection to describe fields only.
> Btw why should it load huge amounts of data ? Mainly it should only get
> field structures.
To describe fields MySQL protocol requires executing query and then fetch all requested data. So, to prevent fetching we need to close connection.
This behavior was made to fix bug with describing statements, which returns huge amount of data. For example, some users tried to describe such statement on design-time and as result, IDE had not responded until all data was fetched.
We will try to enhance this algorithm, but we can't say anything about when we can do that.