Removal of APEX Listener cache folder causes hanging of APEX
August 7, 2012 Leave a comment
Environment: APEX 4.1, GlassFish 3.1.1/3.1.2, APEX Listener 1.1.3, Oracle Linux 6.2 64-bit
In the past couple of months, we had several lock ups of our APEX environments. This all started after we moved to GlassFish with the APEX Listener. The symptoms were always the same: all database connections in the connection pool were in use and hanging, and we had to restart the GlassFish instance to release them.
Today, I was finally able to reproduce this problem at will and I found a solution!
The problem is caused by the removal of the file system folder that the APEX Listener uses to cache files.
We had the file caching enabled to increase the performance of a APEX application which downloads images from the database through a procedure.
This is how our caching is configured:
As you see, the caching folder is set to /tmp/apex/cache. I believe this is the default configuration.
Now, for some reasons, Linux sometimes removes all folders from the /tmp folder. And this not only happens after a server reboot! There must be some process scheduled to do this, but I haven’t found yet which one. When we had a recent hang of APEX I noticed some broken images in the applications. I checked the file system and behold, the file cache folder was gone! A restart of the GlassFish instance (and so also the APEX Listener) recreated the caching folder.
Maybe this issue has been fixed in the newer version 1.1.4 of the APEX Listener, I didn’t try it out yet…
In the mean time, I found a permanent solution for the problem by setting the Cache File Location to a folder outside the /tmp file system, for example /home/oracle/apex/cache.