lib/transactions.js
function () {
        var connection = this.connection();

        // if a connection is defined, get the ID from connection
        if (connection) {
            if (!connection.transactionId) {
                throw new AdapterError(AdapterError.TRANSACTION_NOT_ASSOCIATED);
            }

            return (this._id = connection.transactionId); // save it just in case, during return
        }

        // at this point if we do not have an id, we know that we will need to return a dummy one
        return this._id || (this._id = util.uid());
    }
function () {
        var connection = this.connection();

        // if a connection is defined, get the ID from connection
        if (connection) {
            if (!connection.transactionId) {
                throw new AdapterError(AdapterError.TRANSACTION_NOT_ASSOCIATED);
            }

            return (this._id = connection.transactionId); // save it just in case, during return
        }

        // at this point if we do not have an id, we know that we will need to return a dummy one
        return this._id || (this._id = util.uid());
    }
function ( ) { var connection = this . connection ( ) ; // if a connection is defined, get the ID from connection if ( connection ) { if ( ! connection . transactionId ) { throw new AdapterError ( AdapterError . TRANSACTION_NOT_ASSOCIATED ) ; } return ( this . _id = connection . transactionId ) ; // save it just in case, during return } // at this point if we do not have an id, we know that we will need to return a dummy one return this . _id || ( this . _id = util . uid ( ) ) ; }
Returns the transaction id associated with this transaction instance. If the transaction is not connected,
it creates a new ID and caches it if things are not connected

@returns {string}

@note that this function caches the id in `this._id` and that is directly used in constructor and the
rollback and commit methods.
Returns the transaction id associated with this transaction instance . If the transaction is not connected it creates a new ID and caches it if things are not connected