|
| Service crash on SQLExec without connection |
| Iniciado por guest, 29,ene. 2016 17:08 - 4 respuestas |
| |
| | | |
|
| |
| Publicado el 29,enero 2016 - 17:08 |
Hi everybody, I'm using a service that connects to an external MySQL database, and I'm trying to simulate the loss of this particular connection. The strange thing is that whenever i try to call the function SQLExec to run a simple query (just to check if the connection is still avaliable or not), the service suddenly crashes at that precise spot, without giving SQLExec the possibility to return false.. Is that normal behaviour from it? Here's the code that i actually run: Query is string = "SELECT id, nickname, password FROM users WHERE nickname = '%1' AND password = '%2'"
sQuery2 is string= StringBuild(sQuery,usr,psw) b is string="myQuery" ***IF NOT SQLExec(sQuery2,b) THEN SQLInfo(b) ServiceWriteEventLog("Error:"+SQL.MesError) END
the *** indicates where the service crashes TIA |
| |
| |
| | | |
|
| | |
| |
| Publicado el 29,enero 2016 - 17:26 |
Hi,
if you are using webservice that come with WD then yes it's normal . some error also not catch and return . worse part , it's very slow . |
| |
| |
| | | |
|
| | |
| |
| Publicado el 29,enero 2016 - 17:32 |
Hi CCC2, thank you for your quick answer I agree with you, the handling of errors in webservices could be very tricky... but actually I'm having problems with background services, which run independently as windows services AFAIK |
| |
| |
| | | |
|
| | |
| |
| Publicado el 29,enero 2016 - 17:33 |
If I read well it seems he's talking about a windows service not a webservice.
By the way, I don't know how to help.. my post is only to help keeping the focus on the right issue/question  |
| |
| |
| | | |
|
| | |
| |
| Publicado el 29,enero 2016 - 17:45 |
sorry my fault .
if it work as same when connect to webservice , sqlexec some error are not return . sqlexec will still return true . but crash when call SQLGetCol()
try use catch exception() |
| |
| |
| | | |
|
| | | | |
| | |
|