Page 1 of 1

lost connection at tmyquery with debugger

Posted: Mon 23 Jul 2012 00:42
by markusf
Hello,
i have problems with tmyquery/tmytable, fetchall=false und the debugger.

I use Delphi XE2 Update4 Hotfix1 with mydac 7.2.

With debugger:
Set fetchall=false in a tmyquery or tmytable object
Open a Table
Close a table
now i get an error "lost connection to mysql server during query"

Without debugger:
Set fetchall=false in a tmyquery or tmytable object
Open a Table
Close a table
everthing works fine!

With debugger:
Set fetchall=true in a tmyquery or tmytable object
Open a Table
Close a table
everthing works fine!

There is no time to wait since the error message comes, so i think its no
timeout problem.
In the server-log i have no messages found.
The problem occurs at about 90% of my tables no matter if big or small tables.

Whats wrong here?

Thanks Markus

Re: lost connection at tmyquery with debugger

Posted: Mon 23 Jul 2012 08:06
by AndreyZ
Hello,

In this case the 'Lost connection to MySQL server during query' error is an internal MyDAC error that is used for internal purposes. Such MyDAC behaviour is correct, it is caused by specificity of working with not fetched data. You will see the 'Lost connection to MySql server during query' error only if you run your application from IDE. You will not see this error when you run the executable file of your application.

Re: lost connection at tmyquery with debugger

Posted: Tue 24 Jul 2012 16:00
by markusf
Hi,
This feature is very disturbing during the development.
Are you able to turn it off?
I searched for hours whats wrong with my app or servers.
How can i find the difference between this error an a real lost connection message?

Thanks
Markus

Re: lost connection at tmyquery with debugger

Posted: Wed 25 Jul 2012 08:59
by AndreyZ
The point is that the 'Lost connection to MySql server during query' error is generated by MySQL server. We catch it in the try..except block and that's why you don't see this error when you run the executable file of your application. But when you run your application in IDE, it shows you every exception that occurs, was it managed or not. If you don't want to see managed exceptions in IDE, you should disable the "Notify on language exceptions" debugger option (Delphi XE2 main menu Tools->Options->Debugger Options->Embarcadero Debuggers->Language Exceptions).
The real lost connection exception is not managed by MyDAC, so you catch it in your applications.