Miklos Molnar created JBAS-9519:
-----------------------------------
Summary: JPA Entity(Hibernate) update is not replicated with REPL_SYNC cache
mode
Key: JBAS-9519
URL:
https://issues.jboss.org/browse/JBAS-9519
Project: Application Server 3 4 5 and 6
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Clustering, JBC, JPA / Hibernate
Affects Versions: JBossAS-5.0.0.GA
Environment: windows xp, clustering on same machine with 2 nodes
Reporter: Miklos Molnar
Assignee: Paul Ferraro
Dear JBoss users,
I am using jboss AS 5.0 and I have the following issue :
I am working on POF with having stateless session bean in cluster (round robin) in front
of the hibernate-jpa. The second level cache is turned on.
I have tried all cache configuration (optimistic-shared, pessimistic-shared,
optimistic-entity, etc...), but I do experience in all cases that the Entity update does
not get synced/invalidated on the other node. When a new item is added to the cache it is
always replicated well, but the entity update does not. So this means that on only one
node the second level cache is updated on the other node the old data remains. So when
after the entity update I make the call to the session beans on the different nodes they
return different data for the same entity. On the node which received the entity update
call everything is fine, however the other node does not receive any notification about
the update. I turned the org.hibernate.cache log to INFO and I see
"externalPutRead" command notification when a new item is added to the cache on
the other node, however I see nothing when the entity is updated by the other node. My JPA
Entity's cache configuration is TRANSACTIONAL and the JPA EntityManager access is done
in REQUIRED transaction in the session bean. Do I miss anything?You can see my
persistence.xml here :
--------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="AppStore" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/appstore</jta-data-source>
<class>com.miklos.Customer</class>
<class>com.miklos.Item</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.generate_statistics"
value="true"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property name="hibernate.cache.use_second_level_cache"
value="true"/>
<property name="hibernate.cache.use_query_cache"
value="true"/>
<property name="hibernate.cache.region.factory_class"
value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory"/>
<property name="hibernate.cache.region.jbc2.cfg.query"
value="replicated-query"/>
<property name="hibernate.cache.region.jbc2.cachefactory"
value="java:CacheManager"/>
<property name="hibernate.cache.region.jbc2.cfg.entity"
value="replicated-query"/>
<property name="hibernate.cache.region.jbc2.cfg.collection"
value="replicated-query"/>
</properties>
</persistence-unit>
</persistence>
-------------------------------------------------------------------
Thanks for any comment.
regards, Miklos
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira