1. opensymphony
  2. oscache

Commits

mbog...@81dbac14-341a-0410-aa85-cbcd92e6f43e  committed 8da33cc

Added OSCache and Hibernate.

  • Participants
  • Parent commits bf57818
  • Branches default

Comments (0)

Files changed (3)

File docs/hibernate.html

View file
  • Ignore whitespace
+<html>
+    <head>
+        <title>OSCache and Hibernate</title>
+    </head>
+
+    <body>
+
+        <p><a href="http://www.hibernate.org">Hibernate</a> is a powerful, ultra-high
+        performance object/relational persistence and query service for Java.
+        Hibernate lets you develop persistent objects following common Java idiom -
+        including association, inheritance, polymorphism, composition and the Java
+        collections framework. Extremely fine-grained, richly typed object models
+        are possible.</p>
+        
+        <p>Hibernate 2.1 features support for plugin cache providers and is 
+        designed to integrate with distributed caches (2.1 also implements more 
+        aggressive use of the cache). 
+        <b>net.sf.hibernate.cache.CacheProvider</b> is the extension point for 
+        user-defined cache integration.</p>
+        
+        <p>Hibernate 2.1 beta 6 or higher is required.</p>        
+        
+        <h3>hibernate.cache.provider_class</h3>
+
+        <p>OSCache and Hibernate 2.1 integrate though <b>OSCacheProvider</b>. To 
+        enable OSCache in Hibernate's configuration, add the following line to 
+        hibernate.cfg.xml:</p>
+
+<pre>
+&lt;property name="hibernate.cache.provider_class"&gt;<b>net.sf.hibernate.cache.OSCacheProvider</b>&lt;/property&gt;
+</pre>
+
+        <p>The default refresh period is 
+        <a href="http://www.opensymphony.com/oscache/api/com/opensymphony/oscache/base/CacheEntry.html#INDEFINITE_EXPIRY">CacheEntry.INDEFINITE_EXPIRY</a>.
+        The first time a cacheable query is done, the cache has no effect on 
+        speed. On the second and successive queries, the cache will be populated 
+        and available to be hit.</p>
+        
+        <p>NOTE: object identifiers must have well-behaved <tt>toString()</tt> methods.</p>
+
+        <h3>Configuration</h3>
+
+        <p>To modify the refresh period, CRON expression or maximum cache 
+        capacity, add the region configuration to your oscache.properties file, 
+        as demonstrated below:</p>
+        
+<pre>
+com.mypackage.model.Customer.refresh.period = 4000
+com.mypackage.model.Customer.cron = * * 31 Feb *
+com.mypackage.model.Customer.capacity = 500
+</pre>
+
+        <p>The com.mypackage.model.Customer is Hibernate's internal <b>cache 
+        region</b>, which defaults to the classname, but which can be specified 
+        in the Hibernate mapping files (region attribute of class-cache element 
+        or collection-cache element).</p>
+
+    </body>
+</html>
+        

File docs/index.html

View file
  • Ignore whitespace
   <li><b><a href="configuration.html">Configuration</a></b> - Configuration options for <b>OSCache</b>.</li>
   <li><b><a href="filter.html">Caching Content with the CacheFilter</a></b> - How to configure OSCache to cache entire servlet responses.</li>
   <li><b><a href="tags.html">JSP Tags</a></b> - Detailed documentation on <b>OSCache</b>'s tags and how to use them.</li>
+  <li><b><a href="hibernate.html">OSCache and Hibernate</a></b> - How to integrate OSCache with Hibernate.</li>
   <li><b><a href="clustering.html">Clustering OSCache</a></b> - How to use <code>OSCache</code> in a cluster.</li>
   <li><b><a href="cron.html">Cron Expressions</a></b> - How to use the cron expression syntax to expire content.</li>
   <li><b><a href="api">JavaDoc API</a></b> - The <b>OSCache</b> API documentation in JavaDoc format.</li>

File docs/navpanel.jsp

View file
  • Ignore whitespace
 <a href="<%= request.getContextPath() %>/oscache/tags.html">Tag Reference</a><br>
 <a href="<%= request.getContextPath() %>/oscache/filter.html">The Caching Filter</a><br>
 <a href="<%= request.getContextPath() %>/oscache/cron.html">Cron Expressions</a><br>
+<a href="<%= request.getContextPath() %>/oscache/hibernate.html">OSCache and Hibernate</a><br>
 <a href="<%= request.getContextPath() %>/oscache/clustering.html">Clustering</a><br>
 <a href="<%= request.getContextPath() %>/oscache/api/">API Docs</a>
 </p>