try {
sessionStrategy.beginTransaction();
double rank = pre;
PageMeta meta = pageMetaDAO.findByPage(p);
List<Page> linksIn = pageLinkDAO.findLinksInByPage(p);
if (linksIn == null || linksIn.size() == 0)
continue;
for (Page linkIn : linksIn) {
PageMeta linkInMeta = pageMetaDAO
.findByPage(linkIn);
List<Page> linksOut = pageLinkDAO
.findLinksOutByPage(linkIn);
if (linksOut != null && linksOut.size() != 0)
rank += (linkInMeta.getRank())
/ linksOut.size();
}
if (meta == null) {
meta = new PageMeta(p, new Date(0), 0, rank);
pageMetaDAO.create(meta);
} else
pageMetaDAO.updatePageRank(meta, rank);
sessionStrategy.commitTransaction();