use transaction()
Merge pull request #578 from gharlan/transaction-internal-usage

internal usage of transaction()