2 Replies Latest reply on Aug 8, 2012 1:47 PM by MatthiasHoys

    Removal of cache folder causes hang of APEX Listener with GlassFish

    MatthiasHoys
      Hello,

      We had several unexplained lock-ups of APEX in our environment in the last months. This all happened after we moved to GlassFish with the APEX Listener. The symptoms were always that all connections in the JDBC connection pool were in use and we had to restart the GlassFish server instance to free them up.

      I finally managed to reproduce and find the cause for this recurring problem. The culprit is the caching folder that the APEX Listener uses for file caching. We use this to cache image downloads from the database through a procedure, and the caching folder was set to /tmp/apex/cache. I believe this is the default setting. All went well, when the procedure was called the images were downloaded from the database and cached under /tmp/apex/cache. However, for some (as yet unexplained) reason, Linux sometimes removes this folder from the /tmp file system. This seems to happen from time to time after an unknown period of inactivity. We didn't reboot the server. After the folder is gone, the APEX Listener is unable to recreate it, keeps on creating new database connections until the maximum configured is reached, and we need to restart the GlassFish instance to free them up. This also recreates the caching folder.

      Our environment: GlassFish 3.1.1+3.1.2, APEX Listener 1.1.3, Oracle Linux 6.2. I didn't try out the new APEX Listener 1.1.4 yet so I'm not sure if this has been fixed in the last version.

      (kind of reminds me of the problem where the APEX config file is by default placed under /tmp and also disappears from time to time)

      HTH,
      Matthias
      http://matthiashoys.wordpress.com
        • 1. Re: Removal of cache folder causes hang of APEX Listener with GlassFish
          Udo
          Hello Matthias,
          (kind of reminds me of the problem where the APEX config file is by default placed under /tmp and also disappears from time to time)
          It's exactly the same cause. Why didn't you configure APEX Listener to use a permanent location for its caching directory when you set the config.dir ? The corresponding parameter in the apex-config.xml is named apex.cache.directory and should be set when caching is enabled.
          Of course, it would be helpful if APEX Listener would report an error when its cache dir is missing instead of dying silently. It would be even better to change from caching mode to non-caching mode when such errors occur. Perhaps this will be better in a future release.

          -Udo
          • 2. Re: Removal of cache folder causes hang of APEX Listener with GlassFish
            MatthiasHoys
            Udo wrote:
            Hello Matthias,

            It's exactly the same cause. Why didn't you configure APEX Listener to use a permanent location for its caching directory when you set the config.dir ? The corresponding parameter in the apex-config.xml is named apex.cache.directory and should be set when caching is enabled.
            Yes, now I did. I used the APEX Listener GUI to configure the caching, and I think /tmp/apex/cache is the default folder. That's why I didn't change it...
            Of course, it would be helpful if APEX Listener would report an error when its cache dir is missing instead of dying silently. It would be even better to change from caching mode to non-caching mode when such errors occur. Perhaps this will be better in a future release.
            Yes, it would be better if the APEX Listener would be able to recreate the caching folder when it's not there any more. Now it just hangs, although it does recreate the folder after a restart.


            Matthias