3 Replies Latest reply on Nov 20, 2012 3:24 PM by Cdelahun-Oracle

    How to get an object in the cache after register

    user11344339
      Hello All,

      Im trying to retrieve an object in the cache afer retgister. but ists still not working:

      In the first method i have the following code
      ...
      uow.registerNewObject(myObject);
      dbCon.getActiveUnitOfWork().printRegisteredObjects(); // --> Schl³ssel: [null] Identity Hash-Code: 38596425 Objekt: com.myObject
      ...

      in the second method.
      ...
      Vector args = new Vector();
      args.add(myArgument);
      MyObject myObject= null;

      // Build the query to get the last connect scrore in the cache/database
      ReadObjectQuery roq = new ReadObjectQuery(MyObject.class);
      roq.conformResultsInUnitOfWork();
      ExpressionBuilder expBuilder = roq.getExpressionBuilder();
      Expression exp = expBuilder.get("myArgument").equal(expBuilder.getParameter("myArgument"));

      roq.setSelectionCriteria(exp);
      roq.addArgument("myArgument");
           
      MyObject = (MyObject ) dbConn.getClientSession().executeQuery(roq, args); // Still null

      Thanks