Switch to use DB transactions for dry-run/really mode.

More exceptional conditions handling and reporting.

Change-Id: Icc8a884df070b7c03623d3289af1b3a6b1ed5a28