@@ -304,11 +304,13 @@ function Database(options)
304
304
self . mode = options . mode || null ;
305
305
self . pool = options . pool || null ;
306
306
if ( self . pool ) { // Its a pooled connection
307
+ if ( ! self . realClose ) {
307
308
self . realClose = self . close ;
308
309
self . close = self . poolClose ;
309
310
self . realCloseSync = self . closeSync ;
310
311
self . closeSync = self . poolCloseSync ;
311
- self . connStr = options . connStr || null ;
312
+ }
313
+ self . connStr = options . connStr || null ;
312
314
}
313
315
} // Database()
314
316
@@ -1528,24 +1530,26 @@ Database.prototype.getInfo = function (infoType, infoLen, cb)
1528
1530
} //getInfo
1529
1531
1530
1532
//Proxy all of the ODBCStatement functions so that they are queued
1531
- odbc . ODBCStatement . prototype . _execute = odbc . ODBCStatement . prototype . execute ;
1532
- odbc . ODBCStatement . prototype . _executeSync = odbc . ODBCStatement . prototype . executeSync ;
1533
- odbc . ODBCStatement . prototype . _executeDirect = odbc . ODBCStatement . prototype . executeDirect ;
1534
- odbc . ODBCStatement . prototype . _executeDirectSync = odbc . ODBCStatement . prototype . executeDirectSync ;
1535
- odbc . ODBCStatement . prototype . _executeNonQuery = odbc . ODBCStatement . prototype . executeNonQuery ;
1536
- odbc . ODBCStatement . prototype . _executeNonQuerySync = odbc . ODBCStatement . prototype . executeNonQuerySync ;
1537
- odbc . ODBCStatement . prototype . _prepare = odbc . ODBCStatement . prototype . prepare ;
1538
- odbc . ODBCStatement . prototype . _bind = odbc . ODBCStatement . prototype . bind ;
1539
- odbc . ODBCStatement . prototype . _bindSync = odbc . ODBCStatement . prototype . bindSync ;
1540
- odbc . ODBCStatement . prototype . _setAttr = odbc . ODBCStatement . prototype . setAttr ;
1541
- odbc . ODBCStatement . prototype . _setAttrSync = odbc . ODBCStatement . prototype . setAttrSync ;
1542
- odbc . ODBCStatement . prototype . _close = odbc . ODBCStatement . prototype . close ;
1543
-
1544
- //Proxy all of the ODBCResult functions so that they are queued
1545
- odbc . ODBCResult . prototype . _fetch = odbc . ODBCResult . prototype . fetch ;
1546
- odbc . ODBCResult . prototype . _fetchAll = odbc . ODBCResult . prototype . fetchAll ;
1547
- odbc . ODBCResult . prototype . _getData = odbc . ODBCResult . prototype . getData ;
1548
- odbc . ODBCResult . prototype . _close = odbc . ODBCResult . prototype . close ;
1533
+ if ( ! odbc . ODBCStatement . prototype . _execute ) { //issue #514
1534
+ odbc . ODBCStatement . prototype . _execute = odbc . ODBCStatement . prototype . execute ;
1535
+ odbc . ODBCStatement . prototype . _executeSync = odbc . ODBCStatement . prototype . executeSync ;
1536
+ odbc . ODBCStatement . prototype . _executeDirect = odbc . ODBCStatement . prototype . executeDirect ;
1537
+ odbc . ODBCStatement . prototype . _executeDirectSync = odbc . ODBCStatement . prototype . executeDirectSync ;
1538
+ odbc . ODBCStatement . prototype . _executeNonQuery = odbc . ODBCStatement . prototype . executeNonQuery ;
1539
+ odbc . ODBCStatement . prototype . _executeNonQuerySync = odbc . ODBCStatement . prototype . executeNonQuerySync ;
1540
+ odbc . ODBCStatement . prototype . _prepare = odbc . ODBCStatement . prototype . prepare ;
1541
+ odbc . ODBCStatement . prototype . _bind = odbc . ODBCStatement . prototype . bind ;
1542
+ odbc . ODBCStatement . prototype . _bindSync = odbc . ODBCStatement . prototype . bindSync ;
1543
+ odbc . ODBCStatement . prototype . _setAttr = odbc . ODBCStatement . prototype . setAttr ;
1544
+ odbc . ODBCStatement . prototype . _setAttrSync = odbc . ODBCStatement . prototype . setAttrSync ;
1545
+ odbc . ODBCStatement . prototype . _close = odbc . ODBCStatement . prototype . close ;
1546
+
1547
+ //Proxy all of the ODBCResult functions so that they are queued
1548
+ odbc . ODBCResult . prototype . _fetch = odbc . ODBCResult . prototype . fetch ;
1549
+ odbc . ODBCResult . prototype . _fetchAll = odbc . ODBCResult . prototype . fetchAll ;
1550
+ odbc . ODBCResult . prototype . _getData = odbc . ODBCResult . prototype . getData ;
1551
+ odbc . ODBCResult . prototype . _close = odbc . ODBCResult . prototype . close ;
1552
+ }
1549
1553
1550
1554
odbc . ODBCStatement . prototype . execute = function ( params , cb )
1551
1555
{
0 commit comments