Add transaction support for Jdbc dialects

Transaction support is a no-op for Jdbc dialects.
In some rare cases it's however indispensable to have transaction
support, as in:

  beginTransaction();
  try {
    insertPatchSetAncestors();
    insertPatchSets();
    updateChange();
    commit();
  } catch (OrmException e) {
    rollback();
  }

I assume that I65e111bed was trying to achieve just that.  Make it work
also for Jdbc dialects and not only for NoSQL dialects.

Bug: issue 2034
Bug: issue 2246
Bug: issue 2383
Bug: issue 2702
Change-Id: I29ab37e1cbc78468cb3f8f6abfd1bf54359e6090
7 files changed