Package javax.jdo

Examples of javax.jdo.Transaction.commit()


      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);
      if (curr != HOLLOW){
      fail(ASSERTION_FAILED,
           "Unable to create HOLLOW instance, state is " + states[curr]);
View Full Code Here

    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()");
        }
        finally {
            if ((tx != null) && tx.isActive())
View Full Code Here

            Collection col1 = new HashSet();
            col1.add(p2);
            col1.add(p3);
           
            pm.makePersistentAll(col1);
            tx.commit();
            tx = null;
            if (debug) logger.debug(" \nPASSED in runTestMakePersistent2()");
        }
        finally {
            if ((tx != null) && tx.isActive())
View Full Code Here

            col1.add(p2);
           
            Object[] obj1= col1.toArray();
           
            pm.makePersistentAll(obj1);
            tx.commit();
            tx = null;
            if (debug) logger.debug (" \nPASSED in runTestMakePersistent3()");
        }
        finally {
            if ((tx != null) && tx.isActive())
View Full Code Here

            for(int i = 0; i<numInsert; i++) {
                Object pc = new PCPoint(i, i);
                pm.makePersistent(pc);
                inserted.add(pc);
            }
            tx.commit();
            tx = null;
            if (debug) logger.debug("Total objects inserted : " + numInsert);
        }
        finally {
            if ((tx != null) && tx.isActive())
View Full Code Here

        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            pm.makePersistentAll(pcInstances);
            if (debug) logger.debug("inserted " + pcInstances);
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
View Full Code Here

                    new BigDecimal(String.valueOf(i)),
                    new BigInteger(String.valueOf(i)),
                    new Long(i));
                pm.makePersistent(primitiveObject);
            }
            tx.commit();
            tx = null;
            if (debug) logger.debug("Total objects inserted : " + numInsert);
        }
        finally {
            if ((tx != null) && tx.isActive())
View Full Code Here

                            singleStringQuery);
                }
            } finally {
                query.closeAll();
            }
            tx.commit();
        } catch (JDOUserException e) {
            if (positive) {
                throw e;
            }
        } finally {
View Full Code Here

            Object p3 = new PCPoint(2, 2);
            expected.add(p3);
            expected = getFromInserted(expected);
            printOutput(results, expected);
            checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected);
            tx.commit();
            tx = null;
        }
       
        finally {
            if ((tx != null) && tx.isActive())
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.