Random exceptions while using TMyConnection, TMySSLIOHandler, and TScFileStorage
Posted: Fri  26 Aug 2016 13:29
				
				Hi, I am connectiong to a MySQL server using SSL that uses TMyConnection, TMySSLIOHandler, and TScFileStorage. Here is an example code:
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:
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.
			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;
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.