Skip to content

Commit

Permalink
modifies the Tedious Connection rather than the Connection prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-page committed Jun 9, 2016
1 parent de30465 commit 05d34d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ var Connection = require('tedious').Connection;
var EventEmitter = require('events').EventEmitter;
var util = require('util');

Connection.prototype.release = function() {
function release() {
this.pool.release(this);
};
}

var PENDING = 0;
var FREE = 1;
Expand Down Expand Up @@ -63,6 +63,7 @@ function createConnection(pooled) {

this.log('creating connection: ' + cid);
var connection = new Connection(this.connectionConfig);
connection.release = release;
connection.pool = this;
if (pooled) {
pooled.id = cid++;
Expand Down Expand Up @@ -113,7 +114,7 @@ function createConnection(pooled) {

connection.on('error', handleError);

var endHandler = function () {
endHandler = function () {
self.log('connection ended: ' + pooled.id);
if (self.drained) //pool has been drained
return;
Expand Down

0 comments on commit 05d34d7

Please sign in to comment.