Page 1 of 1

Random exceptions while using TMyConnection, TMySSLIOHandler, and TScFileStorage

Posted: Fri 26 Aug 2016 13:29
by tanvir
Hi, I am connectiong to a MySQL server using SSL that uses TMyConnection, TMySSLIOHandler, and TScFileStorage. Here is an example code:

Code: Select all

MySQL1Connection.Database := 'aaa';
MySQL1Connection.LoginPrompt := false;
MySQL1Connection.Server := 'aaa;
MySQL1Connection.Port := …;
MySQL1Connection.Username := aaa';
MySQL1Connection.Password := 'aa';
MySQL1Connection.Options.Protocol := mpSSL;
MySQL1Connection.IOHandler := MySSLIOHandlerSQL1; //MySSLIOHandlerSQL1 pointed to the storage component where the certificates are stored
MySQL1Connection.Connect;
I am using connection pooling for MySQL connection with TMyConnection. And I also do a lot of multi threading. The code work perfectly when I don't use ssl option and do not use the IOHandler.

Unfortunately when I use teh SSL options and the IOHandler, I get random exceptions while running my code. Here are some example exceptions:

  • 1. a.exe rasied exceptin class socketException with message "Error on data reading from the connection: A blocking operation was interrupted by a call to WSACancelBlockingCall, Socket Error Code: 10004($2714)
  • 2. a.exe raised exception class EScError with message 'Socket closed. Cannot receive data'
  • 3. Protocol error: message is invalid
  • 4. a.exe raised exception class EScError with message 'protocol error: message is invalid

It seems they are more or less similar kind of errors. Can you give me some idea what I am missing or any action to take to solve this issue?
Thanks in advance for your help.

Re: Random exceptions while using TMyConnection, TMySSLIOHandler, and TScFileStorage

Posted: Fri 26 Aug 2016 14:38
by ViktorV
This exceptions are raised internally and they are processed by MyDAC. You can see these exceptions only if you run the application from IDE.
If you want to hide these messages during development of your application, then in the "Debugger Exception Notification" window select the "Ignore this exception type" check box and click "Continue".

Re: Random exceptions while using TMyConnection, TMySSLIOHandler, and TScFileStorage

Posted: Fri 26 Aug 2016 16:43
by worsoee
Hi, thanks for the reply.

It is pretty easy to ignore the exceptions in the IDE, but I'd like to know why internal exceptions are sent to the top user-layer - as opposed in (for example) MyDAC and basically all other components?

The reason I'm chasing this, it that ignoring a lot of exceptions in the IDE can be bad practise in debugging - depending on which exceptions are ignored. Do you know which internal exceptions are exposed to the user (and thus should be ignored)?

Best regards :-)

Re: Random exceptions while using TMyConnection, TMySSLIOHandler, and TScFileStorage

Posted: Mon 29 Aug 2016 07:35
by ViktorV
These errors are a MyDAC internal error, those we handle ourselves. These errors occurrence during debug is correct behavior, since a user won't see these errors in a working application.