Comments (5)
I took your code, threw in a couple of console.log
calls, and found no problems. It connected, executed the statement, and gave me the answer to life, the universe and everything.
var assert = require('assert');
var ConnectionPool = require('tedious-connection-pool');
var Request = require('tedious').Request;
var tediousConfig = {
"userName": "test",
"password": "test",
"server": "192.168.1.212",
"options": {
"database": "test"
}
};
var pool = new ConnectionPool({max: 10, log: true}, tediousConfig);
pool.requestConnection(function (err, connection) {
console.log('connect', err);
if(!err) {
var request = new Request('select 42', function(err, rowCount) {
assert.strictEqual(rowCount, 1);
// Release the connection back to the pool.
connection.close();
console.log('closed');
});
request.on('row', function(columns) {
console.log(columns[0].value);
assert.strictEqual(columns[0].value, 42);
});
connection.on('connect', function(err) {
connection.execSql(request);
});
}
});
This was with tedious
and tedious-connection-pool
freshly installed by npm.
So I'm not sure why it's not working for you.
from tedious-connection-pool.
thanks Mike.
It appears my problem is somewhere within my configuration of freeTDS or
iODBC... i'm still attempting to diagnose at those levels. I appreciate
you having a look
Nick Tackes
On Mon, Nov 26, 2012 at 3:27 PM, Mike D Pilsbury
[email protected]:
I took your code, threw in a couple of console.log calls, and found no
problems. It connected, executed the statement, and gave me the answer to
life, the universe and everything.var assert = require('assert');var ConnectionPool = require('tedious-connection-pool');var Request = require('tedious').Request;
var tediousConfig = {
"userName": "test",
"password": "test",
"server": "192.168.1.212",
"options": {
"database": "test"
}};
var pool = new ConnectionPool({max: 10, log: true}, tediousConfig);
pool.requestConnection(function (err, connection) {
console.log('connect', err);
if(!err) {
var request = new Request('select 42', function(err, rowCount) {
assert.strictEqual(rowCount, 1);// Release the connection back to the pool. connection.close(); console.log('closed'); }); request.on('row', function(columns) { console.log(columns[0].value); assert.strictEqual(columns[0].value, 42); }); connection.on('connect', function(err) { connection.execSql(request); }); }});
So I'm not sure why it's not working for you.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-10739344.
from tedious-connection-pool.
thank you again Mike. My issue had to do with my sql server network configuration not having tcp/ip enabled for my sql server instance.
from tedious-connection-pool.
I'm glad that you've got it sorted.
from tedious-connection-pool.
Hello Mike,
thanks for your great module. I am using Tedious as well as the connection
pool module that you have on github. I was curious if you could provide a
bit of insight on canceling a long running process.
With a process Id i could just use the sp_CancelProcess. Would you
recommend that approach? Has the process id been obtained when a request
or execute sql has been issued?
thanks for any insight,
Nick
On Mon, Nov 26, 2012 at 3:27 PM, Mike D Pilsbury
[email protected]:
I took your code, threw in a couple of console.log calls, and found no
problems. It connected, executed the statement, and gave me the answer to
life, the universe and everything.var assert = require('assert');var ConnectionPool = require('tedious-connection-pool');var Request = require('tedious').Request;
var tediousConfig = {
"userName": "test",
"password": "test",
"server": "192.168.1.212",
"options": {
"database": "test"
}};
var pool = new ConnectionPool({max: 10, log: true}, tediousConfig);
pool.requestConnection(function (err, connection) {
console.log('connect', err);
if(!err) {
var request = new Request('select 42', function(err, rowCount) {
assert.strictEqual(rowCount, 1);// Release the connection back to the pool. connection.close(); console.log('closed'); }); request.on('row', function(columns) { console.log(columns[0].value); assert.strictEqual(columns[0].value, 42); }); connection.on('connect', function(err) { connection.execSql(request); }); }});
So I'm not sure why it's not working for you.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-10739344.
from tedious-connection-pool.
Related Issues (20)
- Issue with connection closed HOT 13
- Update memory-usage test to add validation. HOT 2
- Error: Acquire Timeout Exceeded for queued queries. HOT 6
- error thrown in tedious-connection-pool when calling release() HOT 2
- Acquire calls do not timeout if pool is drained.
- Support tedious 2.0.1? HOT 3
- Allow prepared statements to persist across returning a connection to the pool HOT 2
- new maintainer ? HOT 4
- Multiple Request On Multiple Connection HOT 1
- Error: connection.release is not a function HOT 1
- Incompatibility with Rollup HOT 1
- ConnectionError: Failed to connect to <server name> in 15000ms
- 1.0.5 release may be incompatible with tedious 5.x release HOT 1
- Pause()/resume() doesn't work as expected with connection from connectionPool
- Pool fills up with 'USED' connections - node app restart required as a result HOT 1
- Timeouts don't seem to work as expected
- Draining the pool after releasing connections may cause write to destroyed stream HOT 3
- TypeError: cb is not a function HOT 2
- Is this project dead? HOT 7
- request.transformIntoExecuteSqlRpc() is not a function HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tedious-connection-pool.