1 2 Previous Next 18 Replies Latest reply on May 13, 2015 5:08 PM by humanbeing Go to original post
      • 15. Re: org.infinispan.util.concurrent.TimeoutException
        hr.stoyanov

        ... some more info: it appears that the issue starts after an attempt to clean up the cache:

        ============================================================================

        /**

        * Purge all caches, or for a specific user (if HTTP request parameter "userId" is specified.

        */

        @WebServlet( urlPatterns={"/invalidateCache"})

        public class InvalidateCache extends HttpServlet{

         

         

             private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(InvalidateCache.class);

           

            @Inject @S4G

            private EntityManagerFactory emf;

           

            @Resource(lookup = CACHE_DEFAULT_JNDI)

            private Cache<String,Object> cache;

           

           

          /**

             * Purge all caches, or for a specific user (if HTTP request parameter "userId" is specified.

             *

             * @param req

             * @param res

             */

            @Override

            public void service(ServletRequest req, ServletResponse res){

                emf.getCache().evictAll();

                logger.info( "JPA cache invalidated");

                HttpServletRequest httpReq = (HttpServletRequest) req;

                String userId = String.class.cast(httpReq.getParameter("userId"));

                if(!Strings.isNullOrEmpty(userId)){

                    cache.remove(userId);

                    logger.info( "Infinispan cache invalidated for user: {0}", userId);

                }else{

                    cache.clear();

                    logger.info("Infinispan cache invalidated for everything");

                }

            }

        }

        • 16. Re: org.infinispan.util.concurrent.TimeoutException
          hr.stoyanov

          More info: it appears that the issue starts after an attempt to clear the cache in WF8.2:

          /**

          * Purge all caches, or for a specific user (if HTTP request parameter "userId" is specified.

          */

          @WebServlet( urlPatterns={"/invalidateCache"})

          public class InvalidateCache extends HttpServlet{

           

           

               private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(InvalidateCache.class);

             

              @Inject @S4G

              private EntityManagerFactory emf;

             

              @Resource(lookup = CACHE_DEFAULT_JNDI)

              private Cache<String,Object> cache;

             

             

            /**

               * Purge all caches, or for a specific user (if HTTP request parameter "userId" is specified.

               *

               * @param req

               * @param res

               */

              @Override

              public void service(ServletRequest req, ServletResponse res){

                  emf.getCache().evictAll();

                  logger.info( "JPA cache invalidated");

                  HttpServletRequest httpReq = (HttpServletRequest) req;

                  String userId = String.class.cast(httpReq.getParameter("userId"));

                  if(!Strings.isNullOrEmpty(userId)){

                      cache.remove(userId);

                      logger.info( "Infinispan cache invalidated for user: {0}", userId);

                  }else{

                      cache.clear();

                      logger.info("Infinispan cache invalidated for everything");

                  }

              }

          }

          • 17. Re: org.infinispan.util.concurrent.TimeoutException
            humanbeing

            Hristo,

             

            Just curious, is this from your own code?

            • 18. Re: org.infinispan.util.concurrent.TimeoutException
              humanbeing
              1 2 Previous Next