cretz/node-tds — Issue #3: Server shutdown and reconnect options
Author: nickiv
Created: 2012-01-10 09:56:56+00:00
State: open

Cretz, your work is really great! Api is awesome and pretty full.

I just found some issues related to network problems and server shutdown.

For instance, if SQL server is stopped between connect and statement.execute, exception is thrown:

/usr/local/lib/node_modules/tds/lib/tds-client.js:104
throw new Error('Client must be in LOGGED IN state before executing sql'
^
Error: Client must be in LOGGED IN state before executing sql
at TdsClient.sqlBatch (/usr/local/lib/node_modules/tds/lib/tds-client.js:104:13)
at Statement. (/usr/local/lib/node_modules/tds/lib/tds.js:256:37)
at Statement.execute (/usr/local/lib/node_modules/tds/lib/tds.js:2:59)
at Object.doQuery [as _onTimeout] (/root/nickiv/node/tds.js:45:7)
at Timer.ontimeout (timers.js:84:39)

Can you give some advice on how to handle network outage and server restarts with your client?