cancel
Showing results for 
Search instead for 
Did you mean: 

Node.js v1.0.10 weird disconnect behaviour on SA16

ThiagoReis
Participant
2,220

I have a webserver running a Node.js v1.0.10 that connects to a SA16.

So, every page that needs data from the DB, opens a new connection and closes it at the end.

If I call more than one page at same time, I'll have more than one connection to the database.

The problem starts when I have multiple pages running at the same time and the first one calls the "connection.disconnect" method. At this time, all other connections are affected and all other pages get an connection error. It seems the connection.disconnect closes all opened connections.

I´m creating a new connection in every single page like the GitHub example:

var sqlanywhere = require('sqlanywhere');
var conn = sqlanywhere.createConnection();
var conn_params = {....};

conn.connect ...
conn.exec ...
conn.disconnect();

What am I doing wrong?

Thanks for your time!

Accepted Solutions (1)

Accepted Solutions (1)

graeme_perrow
Advisor
Advisor

Version 1.0.11 (just published to npm) should fix this issue.

ThiagoReis
Participant
0 Kudos

Thank you very much. Very fast. Really appreciate that.

Answers (0)