class ProductCartService extends WebService {

   @PreAuthorize("hasRole('ROLE_DOWNLOAD')")
   @Transactional(propagation = Propagation.REQUIRED)
   public void addProductToCart(String uuid, Long p_id)
         throws UserNotExistingException, ProductNotExistingException
   {
      Product product = productDao.read(p_id);
      if (product == null)
      {
         throw new ProductNotExistingException();
      }

      User user = getUser(uuid);
      String key = "{" + uuid + "-" + p_id.toString() + "}";
      synchronized (BlockingObject.getBlockingObject(key))
      {
         ProductCart cart = getCartOfUser(user);
         if (cart == null)
         {
            cart = createCartOfUser(user);
         }
         if (cart.getProducts() == null)
         {
            cart.setProducts(new HashSet<Product>());
         }
         cart.getProducts().add(product);
         productCartDao.update(cart);
      }
   }

}