Package org.datanucleus.api.jdo

Examples of org.datanucleus.api.jdo.JDOPersistenceManagerFactory


    public PersistenceManagerFactory getPersistenceManagerFactory() {
        return persistenceManagerFactory;
    }

    private void createSchema(final Map<String, String> props, final Set<String> classesToBePersisted) {
        final JDOPersistenceManagerFactory jdopmf = (JDOPersistenceManagerFactory)persistenceManagerFactory;
        final NucleusContext nucleusContext = jdopmf.getNucleusContext();
        final SchemaAwareStoreManager storeManager = (SchemaAwareStoreManager) nucleusContext.getStoreManager();
        storeManager.createSchema(classesToBePersisted, asProperties(props));
    }
View Full Code Here


        if (!configurable)
        {
          return;
        }

        pmf = new JDOPersistenceManagerFactory(properties);
      pmf.setTransactionType(TransactionType.JTA.toString()); // J2EE : default to JTA transactions
        pmf.getNucleusContext().setJcaMode(true); // J2EE : set that using JCA connector

        configurable = false;
    }
View Full Code Here

* @author Max Ross <maxr@google.com>
*/
public class JDODataSourceConfigTest extends TestCase {

  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

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

  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

        synchronizer = new FrameworkSynchronizer();
        lifecycleListener = new IsisLifecycleListener(synchronizer);
    }
   
    private void createSchema(final Map<String, String> props, final Set<String> classesToBePersisted) {
        final JDOPersistenceManagerFactory jdopmf = (JDOPersistenceManagerFactory)persistenceManagerFactory;
        final NucleusContext nucleusContext = jdopmf.getNucleusContext();
        final SchemaAwareStoreManager storeManager = (SchemaAwareStoreManager) nucleusContext.getStoreManager();
        storeManager.createSchema(classesToBePersisted, asProperties(props));
    }
View Full Code Here

TOP

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

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.