Oracle
  Home arrow Oracle arrow Page 3 - Generic Architecture for Caching Table...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Generic Architecture for Caching Table Data: Keeping It Real (and Small)
By: Mark Vilrokx
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2005-10-25

    Table of Contents:
  • Generic Architecture for Caching Table Data: Keeping It Real (and Small)
  • Limit the size of the cache
  • Showing the cache content
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Generic Architecture for Caching Table Data: Keeping It Real (and Small) - Showing the cache content


    (Page 3 of 4 )

    Another useful ability is to be able to see what is actually stored in the cache, so we will create a log_cache procedure:

       PROCEDURE log_cache
       AS
          l_cache_idx   PLS_INTEGER;
       BEGIN
          l_cache_idx := g_dept_cache.FIRST;
          DBMS_OUTPUT.put_line ('Name           Location');
          DBMS_OUTPUT.put_line ('-------------- -------------');
          <<all_records_in_cache>>
          LOOP
             EXIT all_records_in_cache WHEN NOT g_dept_cache.EXISTS
    (l_cache_idx);
             DBMS_OUTPUT.put_line (   LPAD (g_dept_cache
    (l_cache_idx).NAME, 14)
                                   || ' '
                                   || LPAD (g_dept_cache
    (l_cache_idx).LOCATION,
                                            13
                                           )
                                  );
             l_cache_idx := g_dept_cache.NEXT (l_cache_idx);
          END LOOP all_records_in_cache;
       END log_cache;

    I am sending the output of this procedure to the screen, but you might have another mechanism for this, e.g. maybe you log trace messages in a trace table.  You can modify the procedure to use your own logging mechanism.  It is always very handy to be able to peek into the cache, especially when you are debugging.

    More Oracle Articles
    More By Mark Vilrokx


       · Hi,Third article in the (4 part) series, hope you enjoy it. Feel free to pass...
     

       

    ORACLE ARTICLES

    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway