Package javax.jdo

Examples of javax.jdo.PersistenceManager.currentTransaction()


    List<BlogEntry> oldest = (List<BlogEntry>) q.execute(cdat.getTime());
   
    for(BlogEntry be : oldest){
      pm.currentTransaction().begin();
      pm.deletePersistent(be);
      pm.currentTransaction().commit();
      nb++;
    }

    pm.close();
   
View Full Code Here


    if (user == null){
      user = new User();
      user.setId(jid);
      user.setDateCrea(new Date());
      user.setNextUpdate(new Date());
      pm.currentTransaction().begin();
      pm.makePersistent(user);
      pm.currentTransaction().commit();
    }
   
   
View Full Code Here

      user.setId(jid);
      user.setDateCrea(new Date());
      user.setNextUpdate(new Date());
      pm.currentTransaction().begin();
      pm.makePersistent(user);
      pm.currentTransaction().commit();
    }
   
   
    pm.close();
    pm = null;
View Full Code Here

    DataManager dm = DataManagerFactory.getInstance();
    PersistenceManager pm = dm.newPersistenceManager();

    Subscription s = pm.getObjectById(Subscription.class, new Long(id));
    pm.currentTransaction().begin();
    pm.deletePersistent(s);
    pm.currentTransaction().commit();
    pm.flush();

    pm.close();
View Full Code Here

    PersistenceManager pm = dm.newPersistenceManager();

    Subscription s = pm.getObjectById(Subscription.class, new Long(id));
    pm.currentTransaction().begin();
    pm.deletePersistent(s);
    pm.currentTransaction().commit();
    pm.flush();

    pm.close();

    return true;
View Full Code Here

    @SuppressWarnings("unchecked")
    List<Subscription> list = (List<Subscription>) q.execute(user.getKey(),
        blog.getKey());

    if (list.size() > 0) {
      pm.currentTransaction().begin();
      pm.deletePersistent(list.get(0));
      pm.currentTransaction().commit();
      pm.flush();

    }
View Full Code Here

        blog.getKey());

    if (list.size() > 0) {
      pm.currentTransaction().begin();
      pm.deletePersistent(list.get(0));
      pm.currentTransaction().commit();
      pm.flush();

    }
    q.closeAll();
    pm.close();
View Full Code Here

          blog = new Blog();
          blog.setLatestEntry(calLongTime.getTime());
          blog.setNextUpdate(now);
          blog.setLink(link);
          blog.setRss(rss);
          pm.currentTransaction().begin();
          pm.makePersistent(blog);
          pm.currentTransaction().commit();
        }
      } else {
        Logger.getLogger("updateBlog").log(Level.WARNING,
View Full Code Here

          blog.setNextUpdate(now);
          blog.setLink(link);
          blog.setRss(rss);
          pm.currentTransaction().begin();
          pm.makePersistent(blog);
          pm.currentTransaction().commit();
        }
      } else {
        Logger.getLogger("updateBlog").log(Level.WARNING,
            "blog not found : "  + link);
      }
View Full Code Here

     
      user.setInterval(minutes);
      TalkService.sendMessage(id, "blog update every " + minutes + " minute(s)");
    }
   
    pm.currentTransaction().begin();
    pm.flush();
    pm.currentTransaction().commit();
   
    pm.close();
    pm = null;
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.