Optimistic locking not working with JDBCCacheLoader configur
kringdahl Sep 8, 2008 8:22 AMI'm unable to get optimistic locking to work with the JDBCCacheLoader when I use a datasource. When I supply the DS configuration to JBC directly, it works just fine. I have included the exception / stack trace I get below. I'm using 2.2.0.GA. is this a known issue? Could this be a config issue? The onyl thing I change is my cache loader config to get this working outside of the DS supplied by JBoss AS. here is the cache loader config that works:
<attribute name="CacheLoaderConfig"> <config> <!-- if passivation is true, only the first cache loader is used; the rest are ignored --> <passivation>false</passivation> <preload>/</preload> <shared>true</shared> <!-- we can now have multiple cache loaders, which get chained --> <cacheloader> <class>org.jboss.cache.loader.JDBCCacheLoader</class> <properties> cache.jdbc.table.name=dht cache.jdbc.table.primarykey=dht_pk cache.jdbc.table.create=false cache.jdbc.table.drop=false cache.jdbc.fqn.column=fqn cache.jdbc.fqn.type=varchar(255) cache.jdbc.node.column=value cache.jdbc.node.type=BYTEA cache.jdbc.parent.column=parent_fqn cache.jdbc.driver=org.postgresql.Driver cache.jdbc.url=jdbc:postgresql://localhost:5432/fabric?useUnicode=true&characterEncoding=utf-8 cache.jdbc.user=postgres cache.jdbc.password=postgres cache.jdbc.sql-concat=1||2 </properties> <!-- whether the cache loader writes are asynchronous --> <async>false</async> <!-- 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. --> <fetchPersistentState>false</fetchPersistentState> <!-- determines whether this cache loader ignores writes - defaults to false. --> <ignoreModifications>false</ignoreModifications> <purgeOnStartup>false</purgeOnStartup> </cacheloader> </config> </attribute>
Here is the cache loader config that does not work:
<attribute name="CacheLoaderConfig"> <config> <!-- if passivation is true, only the first cache loader is used; the rest are ignored --> <passivation>false</passivation> <preload>/</preload> <shared>true</shared> <!-- we can now have multiple cache loaders, which get chained --> <cacheloader> <class>org.jboss.cache.loader.JDBCCacheLoader</class> <properties> cache.jdbc.table.name=dht cache.jdbc.table.primarykey=dht_pk cache.jdbc.table.create=false cache.jdbc.table.drop=false cache.jdbc.fqn.column=fqn cache.jdbc.fqn.type=varchar(255) cache.jdbc.node.column=value cache.jdbc.node.type=BYTEA cache.jdbc.parent.column=parent_fqn cache.jdbc.datasource=java:/jdbc/FabricDS cache.jdbc.sql-concat=1||2 </properties> <!-- whether the cache loader writes are asynchronous --> <async>false</async> <!-- 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. --> <fetchPersistentState>false</fetchPersistentState> <!-- determines whether this cache loader ignores writes - defaults to false. --> <ignoreModifications>false</ignoreModifications> <purgeOnStartup>false</purgeOnStartup> </cacheloader> </config> </attribute>
Note that the only difference is in the properties.