### Question:
BaseTransactionalExecutor implements Executor<T> { @Override public T execute(Object... args) throws Throwable { if (RootContext.inGlobalTransaction()) { String xid = RootContext.getXID(); statementProxy.getConnectionProxy().bind(xid); } statementProxy.getConnectionProxy().setGlobalLockRequire(RootContext.requireGlobalLock()); return doExecute(args); } BaseTransactionalExecutor(StatementProxy<S> statementProxy, StatementCallback<T, S> statementCallback,
                                     SQLRecognizer sqlRecognizer);  BaseTransactionalExecutor(StatementProxy<S> statementProxy, StatementCallback<T, S> statementCallback,
                                     List<SQLRecognizer> sqlRecognizers); @Override T execute(Object... args);  }### Answer:
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testExecuteWithGlobalLockSet() throws Exception { ConnectionProxy connectionProxy = new ConnectionProxy(null, null); StatementProxy statementProxy = new StatementProxy<>(connectionProxy, null); BaseTransactionalExecutor<Object, Statement> baseTransactionalExecutor = new BaseTransactionalExecutor<Object, Statement>(statementProxy, null, (SQLRecognizer) null) { @Override protected Object doExecute(Object... args) { return null; } }; GlobalLockTemplate<Object> globalLockLocalTransactionalTemplate = new GlobalLockTemplate<>(); try { baseTransactionalExecutor.execute(new Object()); Assertions.assertFalse(connectionProxy.isGlobalLockRequire(), "conectionContext set!"); } catch (Throwable e) { throw new RuntimeException(e); } globalLockLocalTransactionalTemplate.execute(() -> { try { baseTransactionalExecutor.execute(new Object()); Assertions.assertTrue(connectionProxy.isGlobalLockRequire(), "conectionContext not set!"); } catch (Throwable e) { throw new RuntimeException(e); } return null; }); }