Package javax.jdo

Examples of javax.jdo.Transaction.begin()


            pm2.makePersistent (rect2);
           
            tx.commit();
            tx2.commit();
       
            tx.begin();
            tx2.begin();
           
            PCPoint p11a = findPoint (pm, 110, 120);
            if (p11a != p11) {
                fail(ASSERTION_FAILED,
View Full Code Here


    private void generatePersistentInstances()
    {
        if( doPersistentInstancesExist() ) return;
        int i;
        Transaction t = pm.currentTransaction();
        t.begin();
        for( i = 0; i < 50; ++i ){
            StateTransitionObj sto = new StateTransitionObj(i);
            sto.writeField(i);
            pm.makePersistent(sto);
        }
View Full Code Here

    /** */
    private boolean doPersistentInstancesExist()
    {
        boolean ret;
        Transaction t = pm.currentTransaction();
        t.begin();
        Extent e = pm.getExtent(StateTransitionObj.class, false);
        Iterator iter = e.iterator();
        ret = iter.hasNext();
        t.rollback();
        return ret;
View Full Code Here

      Transaction tx = pm.currentTransaction();
      tx.setRetainValues(false); //This should cause eviction of transactional instances when transaction is later commited.
           
      //Test
      tx.begin();
      makePersistentClean(pt);
      tx.commit(); // This should evict pt
      verify(pt);
    }
    }
View Full Code Here

    }

  /** */
    private PCPoint2 getHollowInstance() {
        Transaction tx = pm.currentTransaction();
        tx.begin();
        PCPoint2 pt = new PCPoint2(1,2);
        pm.makePersistent(pt);
        tx.commit();

    int curr = currentState(pt);
View Full Code Here

    /* test makePersistent (Object pc) */
    private void runTestMakePersistent1(PersistenceManager pm) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            pm.makePersistent(p1);
            tx.commit();
            tx = null;
            if (debug) logger.debug(" \nPASSED in runTestMakePersistent1()");
        }
View Full Code Here

    /* test makePersistentAll (Collection pcs) */
    private void runTestMakePersistent2(PersistenceManager pm) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();

            Collection col1 = new HashSet();
            col1.add(p2);
            col1.add(p3);
           
View Full Code Here

    /* test makePersistentAll (Object[] o) */
    private void runTestMakePersistent3(PersistenceManager pm) {
        Transaction tx = pm.currentTransaction();
        try {
            tx = pm.currentTransaction();
            tx.begin();
           
            Collection col1 = new HashSet();
            col1.add(p1);
            col1.add(p2);
           
View Full Code Here

    /** */
    protected void insertPCPoints(PersistenceManager pm, int numInsert) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for(int i = 0; i<numInsert; i++) {
                Object pc = new PCPoint(i, i);
                pm.makePersistent(pc);
                inserted.add(pc);
            }
View Full Code Here

     * Persists the given pc instances.
     * @param pcInstances the pc instances to persist
     */
    private void makePersistentAll(List pcInstances) {
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            pm.makePersistentAll(pcInstances);
            if (debug) logger.debug("inserted " + pcInstances);
            tx.commit();
        } finally {
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.