Package org.datanucleus.api.jdo

Examples of org.datanucleus.api.jdo.JDOPersistenceManager


    {
        PersistenceManagerImpl.LOGGER.debug("Ending DataNucleus XA Resource of transaction "+xid.toString()+" with flags "+flags);
       
        if (flags == XAResource.TMSUCCESS || flags == XAResource.TMSUSPEND)
        {
            JDOPersistenceManager pm = (JDOPersistenceManager)table.get(xid);
            try
            {
                pm.flush();
            }
            finally
            {
                pm.getObjectManager().getTransaction().end();
            }
        }
    }
View Full Code Here


    assertTrue(bm.batchOperationInProgress());
    final ObjectProvider sm1 = newStateManagerMock();
    final ObjectProvider sm2 = newStateManagerMock();
    bm.add(sm1);
    bm.add(sm2);
    JDOPersistenceManager jpm = (JDOPersistenceManager) pm;
    DatastoreManager dm = new DatastoreManager(
            jpm.getExecutionContext().getClassLoaderResolver(), jpm.getExecutionContext().getNucleusContext(),
            new HashMap<String, Object>());
    bm.finish(new DatastorePersistenceHandler(dm));
    assertEquals(Utils.newArrayList(sm1, sm2), providedBatchStateList);
    assertFalse(bm.batchOperationInProgress());
  }
View Full Code Here

    assertTrue(bm.batchOperationInProgress());
    final ObjectProvider sm1 = newStateManagerMock();
    final ObjectProvider sm2 = newStateManagerMock();
    bm.add(sm1);
    bm.add(sm2);
    JDOPersistenceManager jpm = (JDOPersistenceManager) pm;
    DatastoreManager dm = new DatastoreManager(
            jpm.getExecutionContext().getClassLoaderResolver(), jpm.getExecutionContext().getNucleusContext(),
            new HashMap<String, Object>());
    try {
      bm.finish(new DatastorePersistenceHandler(dm));
      fail("expected rte");
    } catch (RuntimeException rte) {
View Full Code Here

  public void testTransactionalPMF() {
    JDOPersistenceManagerFactory pmf =
        (JDOPersistenceManagerFactory) JDOHelper.getPersistenceManagerFactory("transactional");
    DatastoreManager storeMgr = (DatastoreManager) pmf.getNucleusContext().getStoreManager();
    JDOPersistenceManager pm = (JDOPersistenceManager) pmf.getPersistenceManager();
    assertTrue(storeMgr.connectionFactoryIsAutoCreateTransaction());
    pm.close();
    pmf.close();
  }
View Full Code Here

  public void testNonTransactionalPMF() {
    JDOPersistenceManagerFactory pmf =
        (JDOPersistenceManagerFactory) JDOHelper.getPersistenceManagerFactory("nontransactional");
    DatastoreManager storeMgr = (DatastoreManager) pmf.getNucleusContext().getStoreManager();
    JDOPersistenceManager pm = (JDOPersistenceManager) pmf.getPersistenceManager();
    assertFalse(storeMgr.connectionFactoryIsAutoCreateTransaction());
    pm.close();
    pmf.close();
  }
View Full Code Here

TOP

Related Classes of org.datanucleus.api.jdo.JDOPersistenceManager

Copyright © 2018 www.massapicom. 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.