Package javax.jdo

Examples of javax.jdo.PersistenceManager.makePersistent()


    EventClass ec = new EventClass(eventclass_id, event_name, event_displayorder);
    ec.setLastretrieved(now);
    print("Storing:" + ec.toString());

    PersistenceManager pm = PMF.get().getPersistenceManager();
    pm.makePersistent(ec);
    pm.close();

    return;

  }
View Full Code Here


  public void save() throws IOException {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
      // save this
      pm.makePersistent(this);
    } finally {
      try {
        pm.close();
      } catch (Exception e) {
        log.severe(e.toString());
View Full Code Here

      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
      SubscriptionCache.removeUserFromCache(user.getId());
View Full Code Here

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

          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,
            "blog not found : "  + link);
View Full Code Here

        if (photo.getAdditionDate() == null) {
            photo.setAdditionDate(new Date());
        }
        PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
            return pm.makePersistent(photo);
        } catch (RuntimeException re) {
            throw re;
        } finally {
            pm.close();
        }
View Full Code Here

     */
  public static void putCertificate(String purpose, String key) {
    try {
      PersistenceManager pm = PMF.get().getPersistenceManager();
        Certificate cert = new Certificate(purpose, key);
        pm.makePersistent(cert);
    } catch(Exception x) {
    }
  }

}
View Full Code Here

     */
    public void setActivity(Date activity) {
      this.activity = activity;
      PersistenceManager pm = PMF.get().getPersistenceManager();
      try {
      pm.makePersistent(this);
      } catch (JDOObjectNotFoundException e) {
      } finally {
        pm.close();
      }
    }
View Full Code Here

        } catch (Exception x) {
          Logger.getLogger(AuthenticationToken.class.getName()).log(Level.SEVERE, "Token encryption error: "  + x.getMessage(), x);
          x.printStackTrace();
        }
          at = new AuthenticationToken(email, token, publicToken, new Date(), new Date());
          pm.makePersistent(at);
        }
      } finally {
        pm.close();
      }
      return at;
View Full Code Here

      user = pm.getObjectById(SpadgerUser.class, id);
    } catch (JDOObjectNotFoundException e) {
      user = new SpadgerUser();
      user.id = id;
      user.email = id;
      user = pm.makePersistent(user);
      user = pm.detachCopy(user);
    } finally {
      tx.commit();
      pm.close();
    }
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.