deniskuzZ commented on a change in pull request #2272:
URL: https://github.com/apache/hive/pull/2272#discussion_r632448235



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -1792,6 +1807,9 @@ private ValidTxnList getValidTxnList(Connection dbConn, 
String fullTableName, Lo
     PreparedStatement pst = null;
     ResultSet rs = null;
     try {
+      // To reuse dbConn, we should get open transactions at first
+      GetOpenTxnsResponse openTxns = getOpenTxns(dbConn);

Review comment:
       we should have lazy/conditional evaluation here based on the select 
statement, just move it under the if block
   ```
   TxnCommonUtils.createValidReadTxnList(getOpenTxns(dbConn), rs.getLong(1))
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to