1 Reply Latest reply on Feb 15, 2011 7:21 AM by mircea.markus

    Index on JDBCCacheLoader

    maurizio.mercatis

      Hi everybody!!

       

       

      I have developed a cache component to support a web application with JBossCache and it works fine.

       

       

      I have chosen a JDBCCacheLoader to deal with persistence activities. Now for a particular reason I have to schedule a task (during the night) that perform some activities on my contents tree.

       

       

      To visit all my nodes I have set up a recursive function that perform this instruction "node.getChildren()" but it seems quite slow with lots of entries. I have placed an index on "FQN_parent" column to improve the performance and I have observed a great improvement (about 100 times).

       

       

      Considering that JDBC retrieve metadata about index could it be a good idea to support this kind of activities?

       

      <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="true" ignoreModifications="false" purgeOnStartup="false">

                <properties>

                          cache.jdbc.table.name=jbosscache

                          cache.jdbc.table.create=true

                          cache.jdbc.table.drop=true

                          cache.jdbc.table.primarykey=jbosscache_pk

         <!-- cache.jdbc.table.index=ix_jbosscache -->

                          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

                </properties>

      </loader>