Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

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

cdhall opened this issue Sep 19, 2012 · 4 comments

Comments

@cdhall
Copy link

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'
}

@pekim
Copy link
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
Copy link
Author

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?

@pekim
Copy link
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.

@cortfritz
Copy link
Contributor

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

@pekim pekim closed this as completed Sep 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants