[jboss-user] [JBoss Cache] - Hibernate Second Level cache not working properly on Jboss 5.1 cluster
Ciprian Stoica
do-not-reply at jboss.com
Mon Mar 28 09:37:38 EDT 2011
Ciprian Stoica [http://community.jboss.org/people/cipris] created the discussion
"Hibernate Second Level cache not working properly on Jboss 5.1 cluster"
To view the discussion, visit: http://community.jboss.org/message/595950#595950
--------------------------------------------------------------
Hi,
I try to set-up JBoss Cache 2 as a Hibernate Second Level Cache on Jboss 5.1.G.A. As a reference I use the document from here: www.jboss.org/jbossclustering/docs/hibernate-jbosscache-guide-3.pdf.
I run Jboss in a cluster which consists on two Linux machines (RHEL 4 and Ubuntu 10).
My hibernate.cfg.xml contains these lines:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
" http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.url">jdbc:mysql://192.168.223.169:3306/hibtest</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
<mapping resource="ro/memiq/training/hibernate/Usr.hbm.xml"></mapping>
<mapping resource="ro/memiq/training/hibernate/Address.hbm.xml"></mapping>
</session-factory>
</hibernate-configuration>
The cluster starts properly and according to documentation the cache should work properly too. But unfortunately it doesn't. When I read an entity on one node, the I delete it on the other node, then I re-read it on the first node, the entity is still displayed on the first node. The cache on the nodes doesn't synchronize.
I suppose I make a mistake somewhere but I don't see where. If you need more details about the project configuration I will post the here.
Many Thanks,
Ciprian
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595950#595950]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110328/241201c6/attachment.html
More information about the jboss-user
mailing list