Bug #56170 Server disconnect causes "External component has thrown an exception"
Submitted: 21 Aug 2010 21:16 Modified: 12 Oct 2010 16:11
Reporter: Matthew Roberts Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.26 OS:Windows
Assigned to: Sergei Tkachenko CPU Architecture:Any

[21 Aug 2010 21:16] Matthew Roberts
Description:
My girlfriend was editing some table data. The SSH tunnel dropped out (thus abruptly disconnecting workbench from the server).

She clicked "Apply changes to data" and received the following:

"External component has thrown an exception

We are sorry for the inconvenience but an unexpected exception has been raised by one of the MySQL Workbench modules. In order to fix this issue we would kindly ask you to file a bug report. You can do that by pressing the [Report Bug] button below. 

Please make sure to include a detailed description of your actions that lead to this problem.

Thanks a lot for taking the time to help us improve MySQL Workbench!

The MySQL Workbench Team"

Restarting the tunnel (and thus making the MySQL server available) meant the client automagically reconnected and the button worked again.

Presumably the error triggers when reconnecting and the connection is refused.

How to repeat:
1. Start workbench.
2. Edit some data.
3. Force disconnect yourself from the MySQL server (either drop the network connection or SSH tunnel).
4. Click "Apply changes to data".

Suggested fix:
1. Inform the user the operation is not valid at the present time.
2. Warn the user and disable the options to commit data the moment a disconnection is detected.
[23 Aug 2010 12:33] MySQL Verification Team
Thank you for the bug report.
[9 Sep 2010 8:05] Sergei Tkachenko
Crash is fixed. In some cases it takes MySQL connector some time to realize that connection has gone. After that corresponding error message appears on the output page. Once the underlying network connection is restored the last action can be tried again - the database connection will catch up automatically.
[20 Sep 2010 9:55] Sergei Tkachenko
I managed to get mentioned crash when tried to rollback changes to result set after connection with server gets broken.
Fixed.
[8 Oct 2010 17:38] Johannes Taxacher
fix confirmed in repository.
output pane now shows error message when connection is lost and cannot be established. once the connection is back up, clicking apply will re-establish the connection and send the edits to the server.
[12 Oct 2010 16:11] Tony Bedford
An entry has been added to the 5.2.29 changelog:

In the SQL Editor, if some table data was edited, and then the connection to the server was lost, clicking the Apply changes to data toolbar button caused MySQL Workbench to crash.

MySQL Workbench has been changed so that the Output tab now shows an error message when a connection is lost. Once the connection is back up, clicking Apply changes to data will re-establish the connection and send the changes to the server.