Use transactions to handle comments when possible

If the database supports transactions (see gwtorm, not all do)
try to perform some update operations as a single transaction on
the change. This may allow the database to batch together any
record updates, saving some time.

Change-Id: I5af9efe3a541d83515109e3bf9a3497b3d8127de
3 files changed