5 Replies Latest reply: Feb 20, 2014 2:43 PM by rlm RSS

    How to clear a Cached region from a pl/sql cron job?

    rlm

      How can I clear a cached region from pl/sql running in a cron job? The APEX_UTIL.functions seem to only work within an apex app.

       

      Application Express 4.2.3.00.08.

       

      Thanks

        • 2. Re: How to clear a Cached region from a pl/sql cron job?
          Nicolette

          rlm

          rlm wrote:

           

          How can I clear a cached region from pl/sql running in a cron job? The APEX_UTIL.functions seem to only work within an apex app.

           

          Application Express 4.2.3.00.08.

           

          Thanks

          Could you explain what  the underlying problem is that makes you think that this is a possible solution.

          To me it doesn't make any sense to try to clear a client side cache from the server outside of the client context.

           

          Nicolette 

          • 3. Re: How to clear a Cached region from a pl/sql cron job?
            rlm

            We have a long running batch job that produces several tables used for reporting at 6AM every morning.   We have a number of cached APEX graphs and reports that 300 users access throughout the day.  Thought there would be a simple procedure to run at the end of the batch job to clear the cached regions.  Otherwise will have to build some logic in APEX app to sense when batch job completes and check when region cache was created and purge if earlier.

            • 4. Re: How to clear a Cached region from a pl/sql cron job?
              Nicolette

              rlm

               

              12.3.3.5 Utilizing Region Caching states

              The Application Express engine only renders a region from cache if it meets the defined condition. Additionally, regions can be cached specific to a user or cached independent of a user.

              Meaning that if the condition isn't met the region is rendered fresh.

              If you hold the time the region was last freshly rendered in a page item and compare that to the time the job has finished you can get the region from cache when the job isn't finished jet.

               

              Nicolette

              • 5. Re: How to clear a Cached region from a pl/sql cron job?
                rlm

                Thanks for the reply Nicole.

                 

                Yes, but I was trying to avoid getting the cache date for every cached region and then querying the last batch run_date on every page. (Many pages with many regions per page) Seems like a lot of overhead and coding.

                 

                Instead, I now have the batch job update a 'CLEAR_CACHE' flag to 'YES' on a batch log table when job ends. Then added process to each page to check flag. If flag is 'YES' then purge all regions and set flag to 'NO'. 

                 

                Rob