generate: use transaction handling to give a speed boost
Merge pull request #746 from gimick/generate_speedup

generate: use transaction handling to give a speed boost