void rollbackIfNotCommitted(TransactionContext context) {
    if (!context.isCompleted()) {
      LOG.debug("The transaction is not committed and we are leaving the try-with-resources block. Going to rollback: {}", context);
      rollback(context);
    }
  }
Begins a new transaction or returns an existing, depending on the passed Transaction Propagation.
The created transaction is wrapped into a {@link TransactionContext} which is {@link AutoCloseable} and allows using
the wrapper inside a try-with-resources block.

@param propagation The transaction propagation to use.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/TransactionContextManager.java