Oliver Yang [
http://community.jboss.org/people/oliver.yang] created the discussion
"Remote node did not update when modifying a node"
To view the discussion, visit:
http://community.jboss.org/message/544762#544762
--------------------------------------------------------------
Hi, every one
I have two jboss instances with a pojocache each are running in different server and share
one database, I cluster the cache in a group. The cache mode is REPL_SYNC and my cache
loader is JDBC cache loader.When I attach a node and detach a cache, they both work fine,
when I use following codes to modify a cache, only local cache is modified and remote
cache still remain same.
MyObject obj = (MyObject)pojoCache.find("theKey");
obj.setValue("newValue");
//that all
If I should use attach() to attach the modified object again, the remote cache will be
changed. Can any one knows the issue?
I have a cache listener added to the cache to debug all events, but FieldModifiedEvent
event never happened. my cached configuration is:
<?xml version="1.0" encoding="UTF-8" ?>
<server>
<mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper"
name="jboss.cache:service=PojoCache">
<!-- Configure the TransactionManager
<attribute name="TransactionManagerLookupClass">
org.jboss.cache.transaction.DummyTransactionManagerLookup
</attribute> -->
<attribute name="TransactionManagerLookupClass">
org.jboss.cache.transaction.JBossTransactionManagerLookup
</attribute>
<!-- Isolation level : SERIALIZABLE
REPEATABLE_READ (default)
READ_COMMITTED
READ_UNCOMMITTED
NONE
-->
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
<!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
<attribute name="CacheMode">REPL_SYNC</attribute>
<!-- Specific eviction policy configurations. This is LRU -->
<attribute name="EvictionPolicyConfig">
<attribute
name="EvictionPolicyClass">org.jboss.cache.aop.eviction.AopLRUPolicy</attribute>
<config>
<attribute
name="wakeUpIntervalSeconds">10</attribute>
<!-- Cache wide default -->
<region name="/_default_">
<!-- <attribute
name="policyClass">org.jboss.cache.aop.eviction.AopLRUPolicy</attribute>
-->
<attribute name="maxNodes">5000</attribute>
<attribute
name="timeToLiveSeconds">3600</attribute>
</region>
<region name="/user">
<attribute name="maxNodes">5000</attribute>
<attribute
name="timeToLiveSeconds">3600</attribute>
<attribute
name="maxAgeSeconds">86400</attribute>
</region>
<region name="/user_attribute">
<attribute name="maxNodes">5000</attribute>
<attribute name="timeToLiveSeconds">3600</attribute>
<attribute name="maxAgeSeconds">86400</attribute>
</region>
</config>
</attribute>
<attribute name="CacheLoaderConfiguration">
<config>
<!-- if passivation is true, only the first cache loader is used;
the rest are ignored -->
<passivation>false</passivation>
<!-- comma delimited FQNs to preload -->
<!-- are the cache loaders shared in a cluster? -->
<shared>true</shared>
<!-- we can now have multiple cache loaders, which get chained -->
<!-- the 'cacheloader' element may be repeated -->
<cacheloader>
<class>org.jboss.cache.loader.JDBCCacheLoader</class>
<!-- same as the old CacheLoaderConfig attribute -->
<properties>
cache.jdbc.driver=org.postgresql.Driver
cache.jdbc.url=jdbc:postgresql://dev/devdb
cache.jdbc.user=devrole1
cache.jdbc.password=password
cache.jdbc.node.type=VARBINARY
</properties>
<!-- whether the cache loader writes are asynchronous -->
<async>true</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>true</fetchPersistentState>
<!-- determines whether this cache loader ignores writes - defaults
to false. -->
<ignoreModifications>false</ignoreModifications>
<!-- if set to true, purges the contents of this cache loader when
the cache starts up.
Defaults to false. -->
<purgeOnStartup>true</purgeOnStartup>
</cacheloader>
</config>
</attribute>
<!-- Name of cluster. Needs to be the same for all caches,
in order for them to find each other
-->
<attribute name="ClusterName">PojoCacheCluster</attribute>
<!-- JGroups protocol stack properties. -->
<attribute name="ClusterConfig">
<config>
<UDP
mcast_addr="${jgroups.udp.mcast_addr:228.1.2.3}"
mcast_port="${jgroups.udp.mcast_port:48866}"
tos="8"
ucast_recv_buf_size="20000000"
ucast_send_buf_size="640000"
mcast_recv_buf_size="25000000"
mcast_send_buf_size="640000"
loopback="false"
discard_incompatible_packets="true"
max_bundle_size="64000"
max_bundle_timeout="30"
use_incoming_packet_handler="true"
ip_ttl="${jgroups.udp.ip_ttl:2}"
enable_bundling="true"
enable_diagnostics="true"
thread_naming_pattern="cl"
use_concurrent_stack="true"
thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="8"
thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="true"
thread_pool.queue_max_size="1000"
thread_pool.rejection_policy="discard"
oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="8"
oob_thread_pool.keep_alive_time="5000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Run"/>
<PING timeout="2000"
num_initial_members="3"/>
<MERGE2 max_interval="30000"
min_interval="10000"/>
<FD_SOCK/>
<FD timeout="10000" max_tries="5"
shun="true"/>
<VERIFY_SUSPECT timeout="1500" />
<BARRIER />
<pbcast.NAKACK use_stats_for_retransmission="false"
exponential_backoff="150"
use_mcast_xmit="true" gc_lag="0"
retransmit_timeout="50,300,600,1200"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200"/>
<pbcast.STABLE stability_delay="1000"
desired_avg_gossip="50000"
max_bytes="1000000"/>
<VIEW_SYNC avg_send_interval="60000" />
<pbcast.GMS print_local_addr="true"
join_timeout="3000"
shun="false"
view_bundling="true"/>
<FC max_credits="500000"
min_threshold="0.20"/>
<FRAG2 frag_size="60000" />
<!--pbcast.STREAMING_STATE_TRANSFER /-->
<pbcast.STATE_TRANSFER />
<!-- pbcast.FLUSH /-->
</config>
</attribute>
<!-- Whether or not to fetch state on joining a cluster -->
<attribute name="FetchInMemoryState">true</attribute>
<!-- The max amount of time (in milliseconds) we wait until the
initial state (ie. the contents of the cache) are retrieved from
existing members in a clustered environment
-->
<attribute
name="InitialStateRetrievalTimeout">15000</attribute>
<!-- Number of milliseconds to wait until all responses for a
synchronous call have been received.
-->
<attribute name="SyncReplTimeout">15000</attribute>
<!-- Max number of milliseconds to wait for a lock acquisition -->
<attribute name="LockAcquisitionTimeout">10000</attribute>
</mbean>
</server>
Thanks in advance.
Oliver
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/544762#544762]
Start a new discussion in JBoss Cache POJO Edition at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]