To access metastore, we may bypass the JDO layer and query the metastore RDBMS directly (we refer to this as direct SQL path).
There are some methods in Hive metastore that may issue multiple queries against RDBMS to build the return objects (e.g. get_partitions_by_names). Currently going through direct SQL may issue each query to the RDBMS in a different transaction (while afaik going through JDO will create a single transaction to retrieve and compose such objects). This may lead to failures while running some operations concurrently, e.g., in the example above, if a partition is being dropped and partitions are being retrieved using direct SQL path.
A solution would be to execute all statements needed to retrieve the results for such a function within a single transaction when we use direct SQL path.