[jboss-user] [JBossCache] - Re: Problem with JBoss JDBCCacheLoader

hmesha do-not-reply at jboss.com
Fri Dec 15 12:05:02 EST 2006


Are you sure this's your current cache configuration? It doesn't have even the JDBC cache loader configuration which was in your first post?!!

Anyway, I think based on the your first post cache configuration that more than one thread is accessing the data with read committed isolation level which means that Non-repeatable reads may occur. That would result in data retrieved in a SELECT statement may be modified by some other transaction when it commits. 
anonymous wrote : 
  | Actually the scenario is like this:
  | A thread gets a node on the cache and then does some modification on the node and tries to put it back on the cache.
  | There may be multiple threads accessing the same node. 
  | 
So when you do a get on the node (SELECT) the entry wasn't there and therefore loadNode() returns null but then when the transcation commit to the database trying to put the node (INSERT) rather than (UPDATE) the entry was already added by another transaction therefore the insert fails with the primary key violation.

try to set your Isolation Level in the cache config, from your first post, 

FROM

<attribute name="IsolationLevel">READ_COMMITTED</attribute>

To


  | <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
  | 
  | OR 
  | 
  | <attribute name="IsolationLevel">SERIALIZABLE</attribute>
  | 
  | 

Rerun you performance testing and let's know if you're still seeing the issue.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994281#3994281

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994281



More information about the jboss-user mailing list