[jboss-cvs] JBossCache/docs/JBossCache-UserGuide/en/modules ...

Galder Zamarreno galder.zamarreno at jboss.com
Sun Jan 21 10:46:44 EST 2007


  User: gzamarreno
  Date: 07/01/21 10:46:44

  Modified:    docs/JBossCache-UserGuide/en/modules  cache_loaders.xml
  Log:
  [JBCACHE-802] c3p0 JDBC connection pooling functionality and corresponding unit tests added. JDBCCacheLoader has been refactored to provide better reporting by not swallowing exceptions and making ConnectionFactory and implementations separate java class files.
  
  Revision  Changes    Path
  1.2       +64 -1     JBossCache/docs/JBossCache-UserGuide/en/modules/cache_loaders.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: cache_loaders.xml
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/cache_loaders.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- cache_loaders.xml	19 Jan 2007 17:01:00 -0000	1.1
  +++ cache_loaders.xml	21 Jan 2007 15:46:44 -0000	1.2
  @@ -1316,7 +1316,7 @@
   
         <para>See
            <ulink
  -                 url="???">http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader
  +                 url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader">http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader
            </ulink>
            for configuration tips with specific database systems.
         </para>
  @@ -1440,6 +1440,27 @@
            </section>
   
            <section>
  +           <title>c3p0 connection pooling</title>
  +
  +           <para>JBoss Cache now implements JDBC connection pooling when running JBossCache standalone using
  +              the c3p0:JDBC DataSources/Resource Pools library. In order to enable it, just edit the following property:
  +              <itemizedlist>
  +              <listitem><emphasis>cache.jdbc.connection.factory</emphasis>- Connection factory class name.
  +                 If not set, it defaults to standard non pooled implementation. To enable c3p0 pooling, just set the
  +                 connection factory class for c3p0. See example below.</listitem> 
  +              </itemizedlist></para>
  +
  +            <para>You can also set any c3p0 parameters in the same cache loader properties section but don't forget to
  +               start the property name with 'c3p0.'. To find a list of available properties, please check the
  +               c3p0 documentation for the c3p0 library version distributed in
  +               <ulink url="http://sourceforge.net/projects/c3p0">c3p0:JDBC DataSources/Resource Pools</ulink>.
  +               Also, in order to provide quick and easy way to try out different pooling
  +               parameters, any of these properties can be set via a System property overriding any values these
  +               properties might have in the JBoss Cache XML configuration file, for example: -Dc3p0.maxPoolSize=20
  +           </para>
  +         </section>         
  +
  +         <section>
               <title>Configuration example</title>
   
               <para>Below is an example of a JDBC CacheLoader using Oracle as
  @@ -1513,6 +1534,48 @@
                  &lt;/cacheloader&gt;
                  &lt;/config&gt;
                  &lt;/attribute&gt;</programlisting>
  +
  +            <para>Cconfiguration example for a cache loader using c3p0 JDBC connection pooling:</para>
  +
  +              <programlisting>&lt;attribute name="CacheLoaderConfiguration"&gt;
  +      &lt;config&gt;
  +          &lt;passivation&gt;false&lt;/passivation&gt;
  +          &lt;preload&gt;/some/stuff&lt;/preload&gt;
  +          &lt;cacheloader&gt;
  +              &lt;class&gt;org.jboss.cache.loader.JDBCCacheLoader&lt;/class&gt;
  +              &lt;!-- same as the old CacheLoaderConfig attribute --&gt;
  +              &lt;properties&gt;
  +                  cache.jdbc.table.name=jbosscache
  +                  cache.jdbc.table.create=true
  +                  cache.jdbc.table.drop=true
  +                  cache.jdbc.table.primarykey=jbosscache_pk
  +                  cache.jdbc.fqn.column=fqn
  +                  cache.jdbc.fqn.type=varchar(255)
  +                  cache.jdbc.node.column=node
  +                  cache.jdbc.node.type=blob
  +                  cache.jdbc.parent.column=parent
  +                  cache.jdbc.driver=oracle.jdbc.OracleDriver
  +                  cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:JBOSSDB
  +                  cache.jdbc.user=SCOTT
  +                  cache.jdbc.password=TIGER
  +                  cache.jdbc.connection.factory=org.jboss.cache.loader.C3p0ConnectionFactory
  +                  c3p0.maxPoolSize=20
  +                  c3p0.checkoutTimeout=5000
  +              &lt;/properties&gt;
  +              &lt;!-- whether the cache loader writes are asynchronous --&gt;
  +              &lt;async&gt;false&lt;/async&gt;
  +              &lt;!-- only one cache loader in the chain may set fetchPersistentState to true.
  +                   An exception is thrown if more than one cache loader sets this to true. --&gt;
  +              &lt;fetchPersistentState&gt;true&lt;/fetchPersistentState&gt;
  +              &lt;!-- determines whether this cache loader ignores writes - defaults to false. --&gt;
  +              &lt;ignoreModifications&gt;false&lt;/ignoreModifications&gt;
  +              &lt;!-- if set to true, purges the contents of this cache loader when the cache starts up.
  +              Defaults to false.  --&gt;
  +              &lt;purgeOnStartup&gt;false&lt;/purgeOnStartup&gt;
  +          &lt;/cacheloader&gt;
  +      &lt;/config&gt;
  +  &lt;/attribute&gt;</programlisting>
  +
            </section>
         </section>
      </section>
  
  
  



More information about the jboss-cvs-commits mailing list