Package javax.jdo

Examples of javax.jdo.PersistenceManager.currentTransaction()


     * @param positive
     */
    protected void compile(String assertion,
            Query query, String queryText, boolean positive) {
        PersistenceManager pm = getPM();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            query.compile();
            if (!positive) {
                fail(assertion,
View Full Code Here


    private Object execute(String assertion, Query query,
            String singleStringQuery, boolean hasOrdering,
            Object parameters, Object expectedResult, boolean positive) {
        Object result = null;
        PersistenceManager pm = getPM();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            try {
                if (parameters == null) {
                    result = query.execute();
View Full Code Here

    private void delete(String assertion, Query query,
            String singleStringQuery, Object parameters,
            long expectedNrOfDeletedObjects) {
        boolean positive = expectedNrOfDeletedObjects >= 0;
        PersistenceManager pm = getPM();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            try {
                long nr;
                if (parameters == null) {
View Full Code Here

      sub.setPriority(0);
      sub.setUserKey(user.getKey());
      sub.setLastProcessDate(new Date());
      sub.setLatestEntryNotifiedDate(new Date());
     
      pm.currentTransaction().begin();
      pm.makePersistent(sub);
      pm.currentTransaction().commit();

      TalkService.sendMessage(user.getId(),"source added ! :)");
      //update cache
View Full Code Here

      sub.setLastProcessDate(new Date());
      sub.setLatestEntryNotifiedDate(new Date());
     
      pm.currentTransaction().begin();
      pm.makePersistent(sub);
      pm.currentTransaction().commit();

      TalkService.sendMessage(user.getId(),"source added ! :)");
      //update cache
      SubscriptionCache.removeUserFromCache(user.getId());
    } else {
View Full Code Here

          blogs.add(b);

        } catch (JDOObjectNotFoundException ex) {
          // blog deleted ! bad !!
          pm.currentTransaction().begin();
          pm.deletePersistent(sub);
          pm.currentTransaction().commit();
          pm.flush();
          continue;
        }
View Full Code Here

        } catch (JDOObjectNotFoundException ex) {
          // blog deleted ! bad !!
          pm.currentTransaction().begin();
          pm.deletePersistent(sub);
          pm.currentTransaction().commit();
          pm.flush();
          continue;
        }
      }
      mav.getModel().put("blogs", blogs);
View Full Code Here

      @SuppressWarnings("unchecked")
      List<Subscription> ls = (List<Subscription>) sq.execute(b.getKey());
     
      if (ls.size() == 0){
        //delete blog without subscription
        pm.currentTransaction().begin();
        pm.deletePersistent(b);
        pm.currentTransaction().commit();
        nb++;
      }
    }
View Full Code Here

     
      if (ls.size() == 0){
        //delete blog without subscription
        pm.currentTransaction().begin();
        pm.deletePersistent(b);
        pm.currentTransaction().commit();
        nb++;
      }
    }
   
    pm.close();
View Full Code Here

    //fetch ALL blogs
    @SuppressWarnings("unchecked")
    List<BlogEntry> oldest = (List<BlogEntry>) q.execute(cdat.getTime());
   
    for(BlogEntry be : oldest){
      pm.currentTransaction().begin();
      pm.deletePersistent(be);
      pm.currentTransaction().commit();
      nb++;
    }
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.