Package org.objectweb.speedo.pobjects.basic

Examples of org.objectweb.speedo.pobjects.basic.BasicA.writeF1()


    public void testConcurrentWrites2() {
        logger.log(BasicLevel.INFO, "test concurrent writes 2");
        // setup
        BasicA ba = new BasicA();
        ba.writeF1("1");
        ba.writeF2(2);
        PersistenceManager pm = pmf.getPersistenceManager();
        pm.currentTransaction().begin();
        pm.makePersistent(ba);
        final Object id = pm.getObjectId(ba);
View Full Code Here


  public void testNotIgnoreCache() {
    logger.log(BasicLevel.DEBUG, "testSequenceIdNavigateToPrimitive");
    PersistenceManager pm = pmf.getPersistenceManager();
    BasicA ba = new BasicA();
    ba.writeF1("testNotIgnoreCache1");
    ba.writeF2(1);
    pm.makePersistent(ba);
    pm.close();

    pm = pmf.getPersistenceManager();
View Full Code Here

    ba.writeF2(1);
    pm.makePersistent(ba);
    pm.close();

    pm = pmf.getPersistenceManager();
    ba.writeF1("testNotIgnoreCache2");
    pm.setIgnoreCache(false);
    Assert.assertTrue("Bad ignore cache value", !pm.getIgnoreCache());
    Query query = pm.newQuery(BasicA.class);
    query.setFilter("(f1 == \"testNotIgnoreCache2\")");
    Collection col = (Collection) query.execute();
View Full Code Here

        + ", pm:" + NB_PM + ", query: "+ NB_QUERY +") is running ...");
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    for(int i=0; i<20; i++) {
      BasicA ba = new BasicA();
      ba.writeF1("testBillionQuery_" + i);
      pm.makePersistent(ba);
    }
    pm.currentTransaction().commit();
    pm.close();
    for(int i=0; i<NB_PM; i++) {
View Full Code Here

    final int initialValue = 0;
    rollbackExceptions.clear();
    errors.clear();
    Thread[] ts = new Thread[nbThread];
    BasicA ba = new BasicA();
    ba.writeF1("1");
    ba.writeF2(initialValue);
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    pm.makePersistent(ba);
    final BasicA a = ba;
View Full Code Here

          po = (BasicA) pos.remove(0);
      }
      if (po != null) {
        PersistenceManager pm = pmf.getPersistenceManager();
        pm.currentTransaction().begin();
        po.writeF1();
        Object oid = pm.getObjectId(po);
        pm.deletePersistent(po);
        synchronized (removed) {
            removed.add(oid);
        }
View Full Code Here

        return p;
    }
    public void test2thread1PMNoTx() {
        final PersistenceManager pm = pmf.getPersistenceManager();
        BasicA ba = new BasicA();
        ba.writeF1("test2thread1PMNoTx.thread1");
        ba.writeF2(2);
        pm.makePersistent(ba);
        final Object oid = pm.getObjectId(ba);
        Thread t = new Thread(
                new Runnable() {
View Full Code Here

                new Runnable() {
                    public void run() {
                        try {
                            BasicA _ba = ((BasicA) pm.getObjectById(oid, false));
                            _ba.readF1_F2();
                            _ba.writeF1("test2thread1PMNoTx.thread2");
                        } catch (Exception e) {
                            e.printStackTrace();
                            fail(e.getMessage());
                        }
                    }
View Full Code Here


    public void test2thread1PMTx() {
        final PersistenceManager pm = pmf.getPersistenceManager();
        BasicA ba = new BasicA();
        ba.writeF1("test2thread1PM.thread1");
        ba.writeF2(1);
        pm.currentTransaction().begin();
        pm.makePersistent(ba);
        final Object oid = pm.getObjectId(ba);
        Thread t = new Thread(
View Full Code Here

                new Runnable() {
                    public void run() {
                        try {
                            BasicA _ba = ((BasicA) pm.getObjectById(oid, false));
                            _ba.readF1_F2();
                            _ba.writeF1("test2thread1PM.thread2");
                            _ba.writeF2(2);
                            pm.currentTransaction().commit();
                        } catch (Exception e) {
                            e.printStackTrace();
                            fail(e.getMessage());
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.