public void prepareTxn() throws MetaException {
  	String stmt = dbType.getPrepareTxnStmt();
    if (stmt == null) {
      return;
    }
    try {
      assert pm.currentTransaction().isActive(); // must be inside tx together with queries
      executeNoResult(stmt);
    } catch (SQLException sqlEx) {
      throw new MetaException("Error setting ansi quotes: " + sqlEx.getMessage());
    }
  }
This run the necessary logic to prepare for queries. It should be called once, after the
txn on DataNucleus connection is opened, and before any queries are issued. What it does
currently is run db-specific logic, e.g. setting ansi quotes mode for MySQL. The reason it
must be used inside of the txn is connection pooling; there's no way to guarantee that the
effect will apply to the connection that is executing the queries otherwise.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java