TMyquery.FieldDefs.Update create new connection : how to solve this bug ?

TMyquery.FieldDefs.Update create new connection : how to solve this bug ?

Postby swierzbicki » Wed 28 Sep 2005 14:06

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.
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby Ikar » Wed 28 Sep 2005 15:10

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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby swierzbicki » Wed 28 Sep 2005 15:58

:roll:

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
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby GEswin » Wed 28 Sep 2005 16:10

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
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Postby Ikar » Thu 29 Sep 2005 08:06

> 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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components