@Override
      public Object call() throws Exception {
        Context ctx = getCache().getJNDIContext();
        UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
        Region region = getRootRegion("sample");
        Integer x = 0;
        utx.begin();
        region.create(x, new Person("xyz", 45));
        utx.commit();
        QueryService qs = getCache().getQueryService();
        Query q = qs.newQuery("select * from " + SEPARATOR + "sample where age < 50");
        assertEquals(1, ((SelectResults) q.execute()).size());
        Person dsample = (Person) CopyHelper.copy(region.get(x));
        dsample.setAge(55);
        utx.begin();
        switch (op) {
          case TEST_PUT:
            region.put(x, dsample);
            break;
          case TEST_INVALIDATE:
            region.invalidate(x);
            break;
          case TEST_DESTROY:
            region.destroy(x);
            break;
          default:
            fail("unknown op");
        }
        utx.commit();
        assertEquals(0, ((SelectResults) q.execute()).size());
        return null;
      }
verify that queries on indexes work with transaction
geode-core/src/distributedTest/java/org/apache/geode/cache30/TXOrderDUnitTest.java