db: A few `with_transaction`-related fixes.
Authored by: rblank 2010-03-12
Parent: [r9347]
Child: [r9349]