private List<LockInfo> getLocksFromLockId(MultiDataSourceJdbcResource jdbcResource, long extLockId) throws MetaException {
    List<LockInfo> locks = jdbcResource.execute(new GetLocksByLockId(extLockId, -1, jdbcResource.getSqlGenerator()));
    if (locks.isEmpty()) {
      throw new MetaException("This should never happen!  We already " +
          "checked the lock(" + JavaUtils.lockIdToString(extLockId) + ") existed but now we can't find it!");
    }
    LOG.debug("Found {} locks for extLockId={}. Locks: {}", locks.size(), extLockId, locks);
    return locks;
  }
EXCLUSIVE lock on partition should prevent SHARED_READ on the table, however there is no reason
        for an EXCLUSIVE on a table to prevent SHARED_READ on a database. Similarly, EXCLUSIVE on a partition
        should not conflict with SHARED_READ on a database.
        SHARED_READ is usually acquired on a database to make sure it's not dropped, while some operation
        is performed on that db (e.g. show tables, created table, etc).
        EXCLUSIVE on an object may mean it's being dropped or overwritten.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/functions/CheckLockFunction.java