public HiveTxnManager getTxnManager(HiveConf conf) throws
      LockException {
    HiveTxnManager txnMgr = null;

    // Determine the transaction manager to use from the configuration.
    String txnMgrName = conf.getVar(HiveConf.ConfVars.HIVE_TXN_MANAGER);
    if (txnMgrName == null || txnMgrName.isEmpty()) {
      throw new LockException(ErrorMsg.TXNMGR_NOT_SPECIFIED.getMsg());
    }

    // Instantiate the chosen transaction manager
    try {
      HiveTxnManagerImpl impl = (HiveTxnManagerImpl)ReflectionUtils.newInstance(
            conf.getClassByName(txnMgrName), conf);
      impl.setHiveConf(conf);
      txnMgr = impl;
    } catch (ClassNotFoundException e) {
      throw new LockException(ErrorMsg.TXNMGR_NOT_INSTANTIATED.getMsg());
    }
    return txnMgr;
  }
Create a new transaction manager.  The transaction manager to
instantiate will be determined by the hive.txn.manager value in the
configuration.  This should not be called if a transaction manager has
already been constructed and stored in the Context object.
@param conf HiveConf object used to construct the transaction manager
@return the transaction manager
@throws LockException if there is an error constructing the transaction
manager.
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/TxnManagerFactory.java