TalkService.sendMessage(user.getId(),"blog not found ! :(");
return;
}
//check subscription
Subscription sub = dataManager.getSubscription(pm , user, blog);
//create new subscription
if (sub == null){
sub = new Subscription();
sub.setBlogKey(blog.getKey());
sub.setPriority(0);
sub.setUserKey(user.getKey());
sub.setLastProcessDate(new Date());
sub.setLatestEntryNotifiedDate(new Date());
pm.currentTransaction().begin();
pm.makePersistent(sub);
pm.currentTransaction().commit();