diff --git a/lib/transaction.js b/lib/transaction.js index 7548a92..b599354 100644 --- a/lib/transaction.js +++ b/lib/transaction.js @@ -134,3 +134,10 @@ Transaction.begin = function(connector, options, cb) { }); if (cb.promise) return cb.promise; }; + +/** + * Check whether a transaction has an active connection. + */ +Transaction.prototype.isActive = function() { + return !!this.connection; +};