avoid cryptic errors by checking for transaction

Without checking for this.transaction, a simple "access denied" error turns into the cryptic "cannot call commit on undefined" error.
Merge pull request #2782 from cdibbs/master

avoid cryptic errors by checking for transaction