@Override
  public HiveLockManager getLockManager() throws LockException {
    if (lockMgr == null) {
      boolean supportConcurrency =
          conf.getBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY);
      if (supportConcurrency) {
        String lockMgrName =
            conf.getVar(HiveConf.ConfVars.HIVE_LOCK_MANAGER);
        if ((lockMgrName == null) || (lockMgrName.isEmpty())) {
          throw new LockException(ErrorMsg.LOCKMGR_NOT_SPECIFIED.getMsg());
        }

        try {
          LOG.info("Creating lock manager of type " + lockMgrName);
          lockMgr = (HiveLockManager)ReflectionUtils.newInstance(
              conf.getClassByName(lockMgrName), conf);
          lockManagerCtx = new HiveLockManagerCtx(conf);
          lockMgr.setContext(lockManagerCtx);
        } catch (Exception e) {
          // set hiveLockMgr to null just in case this invalid manager got set to
          // next query's ctx.
          if (lockMgr != null) {
            try {
              lockMgr.close();
            } catch (LockException e1) {
              //nothing can do here
            }
            lockMgr = null;
          }
          throw new LockException(ErrorMsg.LOCKMGR_NOT_INITIALIZED.getMsg() +
              e.getMessage());
        }
      } else {
        LOG.info("Concurrency mode is disabled, not creating a lock manager");
        return null;
      }
    }
    // Force a re-read of the configuration file.  This is done because
    // different queries in the session may be using the same lock manager.
    lockManagerCtx.setConf(conf);
    lockMgr.refresh();
    return lockMgr;
  }
An implementation of {@link HiveTxnManager} that does not support
transactions.  This provides default Hive behavior.
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DummyTxnManager.java