@Test
  public void testLockingExternalInStrictModeSelect() throws Exception {
    dropTable(new String[] {"tab_not_acid"});
    driver.run("create external table if not exists tab_not_acid (na int, nb int) " +
        "stored as orc TBLPROPERTIES ('transactional'='false')");
    driver.run("insert into tab_not_acid values(1,2),(3,4)");

    conf.setBoolVar(HiveConf.ConfVars.HIVE_TXN_EXT_LOCKING_ENABLED, true);
    HiveTxnManager txnMgr = TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf);
    txnMgr.openTxn(ctx, "T1");
    driver.compileAndRespond("select * from tab_not_acid", true);
    ((DbTxnManager)txnMgr).acquireLocks(driver.getPlan(), ctx, "T1", false);
    List<ShowLocksResponseElement> locks = getLocks(txnMgr);
    Assert.assertEquals("Unexpected lock count", 1, locks.size());
    TestTxnDbUtil.checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "tab_not_acid", null, locks);
    conf.setBoolVar(HiveConf.ConfVars.HIVE_TXN_EXT_LOCKING_ENABLED, false);
  }
Check to make sure we acquire proper locks for queries involving non-strict locking
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java