Package javax.jdo

Examples of javax.jdo.PersistenceManagerFactory


     */
    @SuppressWarnings("unchecked")
    public EntityManager createEntityManager(Map overridingProps)
    {
        // Create a PMF to do the actual persistence, using the original persistence-unit, plus these properties
        PersistenceManagerFactory thePMF = initialisePMF(unitMetaData, overridingProps);

        // TODO Pass in the PersistenceContextType from metadata (if any)
        return new EntityManagerImpl(this, thePMF, PersistenceContextType.EXTENDED);
    }
View Full Code Here


            props.putAll(overridingProps);
        }
        props.put("org.jpox.autoStartMechanism", "None"); // Dont allow autostart with JPA
        props.remove("org.jpox.PersistenceUnitName"); // Don't specify the persistence-unit

        PersistenceManagerFactory thePMF = JDOHelper.getPersistenceManagerFactory(props);

        if (unitMetaData != null)
        {
            // Load up the MetaData implied by this "persistence-unit"
            ObjectManagerFactoryImpl omf = (ObjectManagerFactoryImpl)thePMF;
View Full Code Here

  private static final boolean NO_EXPLICIT_DEMARCATION = false;
  private static final boolean NON_TXN_OP_ALLOWED = true;
  private static final boolean NON_TXN_OP_NOT_ALLOWED = false;

  public void testWritesWithDatastoreTxn() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    PersistenceManager pm = pmf.getPersistenceManager();
    testWritePermutationWithExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    testWritePermutationWithExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pm.close();
    pmf.close();
  }
View Full Code Here

    pm.close();
    pmf.close();
  }

  public void testUpdatesWithDatastoreTxn() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    testUpdatePermutationWithExpectedDatastoreTxn(pmf, EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    testUpdatePermutationWithExpectedDatastoreTxn(pmf, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pmf.close();
  }
View Full Code Here

    testUpdatePermutationWithExpectedDatastoreTxn(pmf, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pmf.close();
  }

  public void testReadsWithDatastoreTxn() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    PersistenceManager pm = pmf.getPersistenceManager();
    testReadPermutationWithExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    testReadPermutationWithExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pm.close();
    pmf.close();
  }
View Full Code Here

    pm.close();
    pmf.close();
  }

  public void testWritesWithoutDatastoreTxn() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    PersistenceManager pm = pmf.getPersistenceManager();
    testWritePermutationWithoutExpectedDatastoreTxn(pm, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    pm.close();
    pmf.close();

    pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.nontransactional.name());
    pm = pmf.getPersistenceManager();
    testWritePermutationWithoutExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    testWritePermutationWithoutExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    testWritePermutationWithoutExpectedDatastoreTxn(pm, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);

    pm.close();
    pmf.close();
  }
View Full Code Here

    pm.close();
    pmf.close();
  }

  public void testUpdatesWithoutDatastoreTxn() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    testUpdatePermutationWithoutExpectedDatastoreTxn(pmf, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    pmf.close();

    pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.nontransactional.name());
    testUpdatePermutationWithoutExpectedDatastoreTxn(pmf, EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    testUpdatePermutationWithoutExpectedDatastoreTxn(pmf, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    testUpdatePermutationWithoutExpectedDatastoreTxn(pmf, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);

    pmf.close();
  }
View Full Code Here

    pmf.close();
  }

  public void testReadsWithoutDatastoreTxn() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    PersistenceManager pm = pmf.getPersistenceManager();
    testReadPermutationWithoutExpectedDatastoreTxn(pm, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    pm.close();
    pmf.close();

    pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.nontransactional.name());
    pm = pmf.getPersistenceManager();
    testReadPermutationWithoutExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);
    testReadPermutationWithoutExpectedDatastoreTxn(pm, EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    testReadPermutationWithoutExpectedDatastoreTxn(pm, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_ALLOWED);

    pm.close();
    pmf.close();
  }
View Full Code Here

    pm.close();
    pmf.close();
  }

  public void testIllegalWrites() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    PersistenceManager pm = pmf.getPersistenceManager();
    testIllegalWritePermutation(pm, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pm.close();
    pmf.close();
    pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.nontransactional.name());
    pm = pmf.getPersistenceManager();
    testIllegalWritePermutation(pm, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pm.close();
    pmf.close();
  }
View Full Code Here

    pm.close();
    pmf.close();
  }

  public void testIllegalUpdates() throws Exception {
    PersistenceManagerFactory pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.transactional.name());
    testIllegalUpdatePermutation(pmf, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pmf.close();
    pmf = getPersistenceManagerFactory(
        JDOTestCase.PersistenceManagerFactoryName.nontransactional.name());
    testIllegalUpdatePermutation(pmf, NO_EXPLICIT_DEMARCATION, NON_TXN_OP_NOT_ALLOWED);
    pmf.close();
  }
View Full Code Here

TOP

Related Classes of javax.jdo.PersistenceManagerFactory

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.