Package javax.jdo

Examples of javax.jdo.Transaction.commit()


            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) {
                String msg = "JDOUserException thrown while executing query:\n" +
                        singleStringQuery;
                throw new JDOException(msg, e);
View Full Code Here

        query.setFilter("department == d");
        result = query.execute(dept1);
        checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d",
                result, expected);

        tx.commit();
        tx = null;
    }
   
    /** */
    public void testPositive() {
View Full Code Here

            pm.retrieve(p3);
            pm.retrieve(rect);
            pm.makeTransient(p1);
            pm.makeTransient(p3);
            pm.makeTransient(rect);
            tx.commit();
            tx = null;
            checkP1();
            checkP3();
            checkRectP1();
            checkRectId();
View Full Code Here

            coll.add(p1);
            coll.add(p3);
            coll.add(rect);
            pm.retrieveAll(coll);
            pm.makeTransientAll(coll);
            tx.commit();
            tx = null;
            checkP1();
            checkP3();
            checkRectP1();
            checkRectId();
View Full Code Here

            coll.add(p1);
            coll.add(p3);
            coll.add(rect);
            pm.retrieveAll(coll, true);
            pm.makeTransientAll(coll);
            tx.commit();
            tx = null;
            checkP1();
            checkP3();
            // checkRectP1(); p1 is not in the default fetch group by default
            checkRectId();
View Full Code Here

            coll.add(p1);
            coll.add(p3);
            coll.add(rect);
            pm.retrieveAll(coll, false);
            pm.makeTransientAll(coll);
            tx.commit();
            tx = null;
            checkP1();
            checkP3();
            checkRectP1();
            checkRectId();
View Full Code Here

            objs[0] = p1;
            objs[1] = p3;
            objs[2] = rect;
            pm.retrieveAll(objs);
            pm.makeTransientAll(objs);
            tx.commit();
            tx = null;
            checkP1();
            checkP3();
            checkRectP1();
            checkRectId();
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.