You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//acquire a connection
pool.acquire(function (err, connection) {
if (err) {
console.error(err);
return;
}
//use the connection as normal
var request = new Request('SELECT * FROM Persons', function(err, rowCount) {
if (err) {
console.error(err);
return;
}
console.log('rowCount: ' + rowCount);
//release the connection back to the pool when finished
connection.release();
});
request.on('row', function(columns) {
request.pause()
// connection.pauseRequest(request)
console.log('value: ' + columns[0].value);
});
connection.execSql(request);
});
Expected Behavior
The expectation is that the request will be paused after reading a row.
Current Behavior
The connection continues to read all the rows instead of pausing the request after reading a row
Possible Fix
The tedious module being used is of older version which doesn't support pause()/resume() functionality. Updating the tedious module version to 2.2.3 in package.json would fix the issue.
Can you please help?
The text was updated successfully, but these errors were encountered:
Hello, I am trying to run the below code
var ConnectionPool = require('tedious-connection-pool');
var Request = require('tedious').Request;
var poolConfig = {
min: 2,
max: 4,
log: true
};
var connectionConfig = {
userName: 'sa',
password: 'reallyStrongPwd123',
server: 'localhost'
};
//create the pool
var pool = new ConnectionPool(poolConfig, connectionConfig);
pool.on('error', function(err) {
console.error(err);
});
//acquire a connection
pool.acquire(function (err, connection) {
if (err) {
console.error(err);
return;
}
});
Expected Behavior
The expectation is that the request will be paused after reading a row.
Current Behavior
The connection continues to read all the rows instead of pausing the request after reading a row
Possible Fix
The tedious module being used is of older version which doesn't support pause()/resume() functionality. Updating the tedious module version to 2.2.3 in package.json would fix the issue.
Can you please help?
The text was updated successfully, but these errors were encountered: