Package javax.jdo

Examples of javax.jdo.Transaction.commit()


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


            objs[0] = p1;
            objs[1] = p3;
            objs[2] = rect;
            pm.retrieveAll(objs, false);
            pm.makeTransientAll(objs);
            tx.commit();
            tx = null;
            checkP1();
            checkP3();
            checkRectP1();
            checkRectId();
View Full Code Here

                logger.debug("p3: " + p3.name());
                logger.debug("rect id: " + rect.getId() +
                             ", upperLeft: " + rect.getUpperLeft().name() +
                             ", lowerRight: " + rect.getLowerRight().name());
            }
            tx.commit();
            tx = null;
        }
        finally {
            if ((tx != null) && tx.isActive())
                tx.rollback();
View Full Code Here

    protected List getAllEmployees(PersistenceManager pm) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            List allEmployees = (List)pm.newQuery(Employee.class).execute();
            tx.commit();
            return allEmployees;
        } finally {
            if ((tx != null) && tx.isActive()) {
                tx.rollback();
            }
View Full Code Here

      user.id = id;
      user.email = id;
      user = pm.makePersistent(user);
      user = pm.detachCopy(user);
    } finally {
      tx.commit();
      pm.close();
    }
    return user;
  }
View Full Code Here

            c.setCraftsman(c.getCraftsman() + 1);
          }
        }
        pm.makePersistent(c);
       
        tx.commit();
        log.info("Count:" + c.toString());
        return c;
      }finally{
        if(tx.isActive()) tx.rollback();
      }
View Full Code Here

    PersistenceManager pm = PMF.get().getPersistenceManager();
    Transaction tx = pm.currentTransaction();
    try {
      tx.begin();
      pm.deletePersistentAll(objectsToDelete);
      tx.commit();
     
      for(Object obj: objectsToDelete)
      {
        try{
        if (obj instanceof Keyed)
View Full Code Here

          c = pm.getObjectById(Count.class, ViewConstants.PRIMARYKEY_ID);
        }catch(Exception e){
          log.log(Level.INFO, "Count 取得中例外", e);
          c = new Count();
        }
        tx.commit();
        log.info("Count:" + c.toString());
        return c;
      }finally{
        if(tx.isActive()) tx.rollback();
      }
View Full Code Here

      pm = pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
      try{
        tx.begin();
        pm.makePersistent(sum);
        tx.commit();
        log.info("[SummaryCronService#execute()] save summary: " + sum);
      }finally{
        if(tx!=null&&tx.isActive()) tx.rollback();
      }
    }finally{
View Full Code Here

          log.info("[ResultsCronService#execute()] " +
              "insert result list (pre): " + r);
          pm.makePersistentAll(r);
          log.info("[ResultsCronService#execute()] " +
              "insert result (post): " + resultList.size());
          tx.commit();
         
          log.info("[ResultsCronService#execute()] commited");
        }
        StatisticsManager.getInstance().clearResults();
      }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.