コード例 #1
0
 // Check if product present is the DB is still present into the repository.
 @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
 public void checkDBProducts() {
   logger.info("Syncing database with repositories...");
   Iterator<Product> products = productDao.getAllProducts();
   while (products.hasNext()) {
     Product product = products.next();
     if (!ProductService.checkUrl(product.getPath())) {
       logger.info("Removing Product " + product.getPath() + " not found in repository.");
       products.remove();
     } else logger.info("Product " + product.getPath() + " found in repository.");
   }
 }