Move transaction begin and comit up to appropriate level
Merge pull request #124 from wmde/transaction

Move transaction begin and comit up to appropriate level