public static void main(String[] args) throws Exception {


    Region currRegion;
    Cache cache = null;
    // DistributedSystem system = null;
    // HashMap regionDefaultAttrMap = new HashMap();
    tableName = CacheUtils.init("TestXACache");
    cache = CacheUtils.getCache();
    currRegion = cache.getRegion("root");
    try {
      Context ctx = cache.getJNDIContext();
      UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
      utx.begin();
      AttributesFactory fac = new AttributesFactory(currRegion.getAttributes());
      fac.setCacheLoader(new TestXACacheLoader());
      Region re = currRegion.createSubregion("employee", fac.create());
      System.out.println(re.get(args[0]));
      utx.rollback();
      System.out.println(re.get(args[0]));
      cache.close();
      ExitCode.FATAL.doSystemExit();
    } catch (Exception e) {
      e.printStackTrace();
      cache.close();
    }
  }
A <code>CacheLoader</code> used in testing. Users should override the "2" method.


@since GemFire 3.0
geode-core/src/test/java/org/apache/geode/internal/jta/functional/TestXACacheLoader.java