Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

not working with sql server native client 11 (in azure) #49

Closed
cdhall opened this Issue Sep 19, 2012 · 4 comments

Comments

Projects
None yet
3 participants

cdhall commented Sep 19, 2012

I tried my code on sql server r2 and it works but it does not work on sql azure which is using sql server native client 11. Any ideas?
I also tried adding some options, but in vain.

options : {
database: 'xxxxxxxx',
driver: 'SQL Server Native Client 11.0'
}

Collaborator

pekim commented Sep 19, 2012

What messages are emitted from the connection's info and error events?

I understand that azure only supports SQL Server connections with encryption. So the first question is, have you enabled encryption on the connection? The encrypt property in the connection config options needs to be true. (http://pekim.github.com/tedious/api-connection.html#function_newConnection)

var config = {
    ...
    options: {
        encrypt: true,
        ...
    },
    ...
};

It's possible that even with encryption enabled, there's a problem with the encryption. I've had mixed results trying to get it to work.

To try and get a better understanding of the problem, can you enable some debugging logging please?
In your connection config object can you enable all debug logging options please?

var config = {...}
config.options = {}
config.options.debug = {
    packet: true,
    data: true,
    payload: true,
    token: true,
    log: true
}

Then on the Connection object, log debug events.

connection.on('debug', function(text) }
    console.log(text)
});

This should produce a whole bunch of debug data. If you can add it to this issue (or as a gist), then I'll take a look at it. (You'll probably want to redact the username and password.)

cdhall commented Sep 19, 2012

it works now.
Thanks for the help.

Yes, I had to use encrypt: true in options.

Also userName in config had to be changed to user@servername.database.windows.net

The error showed up after enabling encrypt: true in config.options
and enabling debugging the way you suggested.

Thanks a lot for your help.
Just curious - how do you handle connection pooling?

Collaborator

pekim commented Sep 20, 2012

There's currently no in-built support for connection pooling. There are a couple of implementations that you might like to look at.

I'm not totally convinced that connection pooling belongs in tedious. My feeling is that it's a separate concern, and should perhaps be in separate library. However this isn't something that I feel strongly about, and I could probably be persuaded to include it.

Contributor

cortfritz commented Sep 28, 2012

pooling: I agree. generic-pool works great. node loves small modules.

@pekim pekim closed this Sep 29, 2012

momow pushed a commit to momow/tedious that referenced this issue Oct 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment