* @throws HiveException
* Throws this exception if an unexpected error occurs.
*/
private int lockDatabase(LockDatabaseDesc lockDb) throws HiveException {
Context ctx = driverContext.getCtx();
HiveTxnManager txnManager = ctx.getHiveTxnManager();
if (!txnManager.supportsExplicitLock()) {
throw new HiveException(ErrorMsg.LOCK_REQUEST_UNSUPPORTED,
conf.getVar(HiveConf.ConfVars.HIVE_TXN_MANAGER));
}
HiveLockManager lockMgr = txnManager.getLockManager();
if (lockMgr == null) {
throw new HiveException("lock Database LockManager not specified");
}
HiveLockMode mode = HiveLockMode.valueOf(lockDb.getMode());