Examples of PObject


Examples of com.ponysdk.ui.server.basic.PObject

                }
                return;
            }
        }

        final PObject object = weakReferences.get(instruction.getLong(PROPERTY.OBJECT_ID));

        if (object == null) {
            log.warn("unknown reference from the browser. Unable to execute instruction: " + instruction);
            try {
                if (instruction.has(PROPERTY.PARENT_ID)) {
                    final PObject parentOfGarbageObject = weakReferences.get(instruction.getLong(PROPERTY.PARENT_ID));
                    log.warn("parent: " + parentOfGarbageObject);
                }
            } catch (final Exception e) {}

            return;
View Full Code Here

Examples of jscicalc.pobject.PObject

  int position = getDotPosition();
  //System.err.println( textPane.getCaretPosition() );
  //System.err.print( "position = " );
  //System.err.println( position );
  /* put text in textPane */
  PObject p = parser.del( position );
  if( p == null ){
      dotPosition = navigator.dots().get( position );
      return;
  }
  //System.out.println( p.name() );
  int length = 0;
  length = p.name_array().length;
  expression = parser.getExpression();
  /* change dots to match */
  int currentDot = navigator.dots().get( position );
  navigator.dots().remove( position );
  for( int i = position; i < navigator.dots().size(); ++i ){
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

            ? emfWithDataCache : emfWithoutDataCache;
        emf.getConfiguration().setRefreshFromDataCache(refreshFromDataCache);
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
       
        em.getTransaction().begin();
        PObject pc = new PObject();
        pc.setName(useDataCache ? MARKER_DATACACHE : MARKER_CACHE);
        em.persist(pc);
        em.getTransaction().commit();
       
        Object oid = pc.getId();
        StoreCache dataCache = emf.getStoreCache();
        assertEquals(useDataCache, dataCache.contains(PObject.class, oid));
       
        // Modify the record in the database in a separate transaction using
        // native SQL so that the in-memory instance is not altered
        em.getTransaction().begin();
        String sql = "UPDATE L2_PObject SET NAME='" + MARKER_DATABASE
        + "' WHERE id=" + oid;
        em.createNativeQuery(sql).executeUpdate();
        em.getTransaction().commit();
       
        assertEquals(useDataCache ? MARKER_DATACACHE : MARKER_CACHE,
                pc.getName());
       
        em.getTransaction().begin();
        if (makeDirtyBeforeRefresh) {
            pc.setName(MARKER_DIRTY_CACHE);
        }
        assertEquals(makeDirtyBeforeRefresh, em.isDirty(pc));

        if (lock != null) {
            ((EntityManagerImpl)em).getFetchPlan().setReadLockMode(lock);
        }
        em.refresh(pc);
       
        assertEquals(expected, pc.getName());
        em.getTransaction().commit();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

            ? emfWithDataCache : emfWithoutDataCache;
           
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
       
        em.getTransaction().begin();
        PObject pc = new PObject();
        pc.setName(useDataCache ? MARKER_DATACACHE : MARKER_CACHE);
        em.persist(pc);
        em.getTransaction().commit();
       
        Object oid = pc.getId();
        StoreCache dataCache = emf.getStoreCache();
        assertEquals(useDataCache, dataCache.contains(PObject.class, oid));
       
        // delete the record in the database in a separate transaction using
        // native SQL so that the in-memory instance is not altered
        em.getTransaction().begin();
        String sql = "DELETE FROM L2_PObject WHERE id="+oid;
        em.createNativeQuery(sql).executeUpdate();
        em.getTransaction().commit();
       
        // the object cache does not know that the record was deleted
        assertTrue(em.contains(pc));
        // nor does the data cache
        assertEquals(useDataCache, dataCache.contains(PObject.class, oid));
       
        /**
         * refresh behavior no more depends on current lock. Refresh
         * will always attempt to fetch the instance from database
         * raising EntityNotFoundException.
         *  
         */
        em.getTransaction().begin();
        em.getFetchPlan().setReadLockMode(lock);
        if (dirty)
            pc.setName("Dirty Name");
        try {
            em.refresh(pc);
            if (expectedExceptionType != null) {
                fail("expected " + expectedExceptionType.getSimpleName() +
                        " for PObject:" + oid);
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

    OpenJPAConfiguration conf = emf.getConfiguration();
   
    // ensure that PObject is in metadata repository
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    PObject pc = new PObject();
    em.persist(pc);
   
    int oldValue = conf.getDataCacheTimeout();
   
    ClassMetaData meta = conf.getMetaDataRepositoryInstance()
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

    OpenJPAConfiguration conf = emf.getConfiguration();
   
    // ensure that PObject is in metadata repository
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    PObject pc = new PObject();
    em.persist(pc);
   
    int oldValue = conf.getDataCacheTimeout();
   
    ClassMetaData meta = conf.getMetaDataRepositoryInstance()
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

    OpenJPAConfiguration conf = emf.getConfiguration();
   
    // ensure that PObject is in metadata repository
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    PObject pc = new PObject();
    em.persist(pc);
   
    int oldValue = conf.getDataCacheTimeout();
   
    ClassMetaData meta = conf.getMetaDataRepositoryInstance()
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

      ? emfWithDataCache : emfWithoutDataCache;
    emf.getConfiguration().setRefreshFromDataCache(refreshFromDataCache);
    OpenJPAEntityManagerSPI em = emf.createEntityManager();
       
    em.getTransaction().begin();
    PObject pc = new PObject();
    pc.setName(useDataCache ? MARKER_DATACACHE : MARKER_CACHE);
    em.persist(pc);
    em.getTransaction().commit();
   
    Object oid = pc.getId();
    StoreCache dataCache = emf.getStoreCache();
    assertEquals(useDataCache, dataCache.contains(PObject.class, oid));
   
    // Modify the record in the database in a separate transaction using
    // native SQL so that the in-memory instance is not altered
    em.getTransaction().begin();
    String sql = "UPDATE POBJECT SET NAME='"+ MARKER_DATABASE +"' WHERE id="+oid;
    em.createNativeQuery(sql).executeUpdate();
    em.getTransaction().commit();
   
    assertEquals(useDataCache ? MARKER_DATACACHE : MARKER_CACHE, pc.getName());
   
    em.getTransaction().begin();
    if (makeDirtyBeforeRefresh) {
      pc.setName(MARKER_DIRTY_CACHE);
    }
    assertEquals(makeDirtyBeforeRefresh, em.isDirty(pc));

    if (lock != null) {
      ((EntityManagerImpl)em).getFetchPlan().setReadLockMode(lock);
    }
    em.refresh(pc);
   
    assertEquals(expected, pc.getName());
    em.getTransaction().commit();
  }
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

      ? emfWithDataCache : emfWithoutDataCache;
     
    OpenJPAEntityManagerSPI em = emf.createEntityManager();
       
    em.getTransaction().begin();
    PObject pc = new PObject();
    pc.setName(useDataCache ? MARKER_DATACACHE : MARKER_CACHE);
    em.persist(pc);
    em.getTransaction().commit();
   
    Object oid = pc.getId();
    StoreCache dataCache = emf.getStoreCache();
    assertEquals(useDataCache, dataCache.contains(PObject.class, oid));
   
    // delete the record in the database in a separate transaction using
    // native SQL so that the in-memory instance is not altered
    em.getTransaction().begin();
    String sql = "DELETE FROM POBJECT WHERE id="+oid;
    em.createNativeQuery(sql).executeUpdate();
    em.getTransaction().commit();
   
    // the object cache does not know that the record was deleted
    assertTrue(em.contains(pc));
    // nor does the data cache
    assertEquals(useDataCache, dataCache.contains(PObject.class, oid));
   
    /**
     * refresh behavior no more depends on current lock. Refresh
     * will always attempt to fetch the instance from database
     * raising EntityNotFoundException.
     *  
     */
    em.getTransaction().begin();
    em.getFetchPlan().setReadLockMode(lock);
    if (dirty)
      pc.setName("Dirty Name");
    try {
      em.refresh(pc);
      if (expectedExceptionType != null) {
        fail("expected " + expectedExceptionType.getSimpleName() +
            " for PObject:" + oid);
View Full Code Here

Examples of org.apache.openjpa.persistence.datacache.common.apps.PObject

    OpenJPAConfiguration conf = emf.getConfiguration();
   
    // ensure that PObject is in metadata repository
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    PObject pc = new PObject();
    em.persist(pc);
   
    int oldValue = conf.getDataCacheTimeout();
   
    ClassMetaData meta = conf.getMetaDataRepositoryInstance()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.