[jboss-user] [JBoss Cache: Core Edition] - Re: Problem with transaction (jbossta/jbossts) configuration
jreeman
do-not-reply at jboss.com
Fri Jul 11 07:02:19 EDT 2008
I have a cluster with two servers where the following code is executed (I tried with a final rollback and commit).
It's a very simple test, and I have to make more tests to know if the lock for cached data works fine but it's a good point that this snippet works fine as expected.
| String value = String.valueOf(random.nextInt());
| Fqn<String> testFqn = Fqn.fromString("/my/tests");
| TransactionManager txManager = new TxManagerLookup().getTransactionManager();
| txManager.begin();
|
| Node<String, String> rootNode = TechnicalDataCache.get().getRoot();
|
| Node<String, String> testNode = rootNode.addChild(testFqn);
| LOG.info("jboss cache test. Value before update is : " + testNode.get("randomInt"));
| testNode.put("randomInt", value);
| LOG.info("jboss cache test. Value after update is : " + testNode.get("randomInt"));
|
|
txManager.commit();
or
txManager.commit();
I used this configuration file :
<?xml version="1.0" encoding="UTF-8"?>
|
| <server>
|
| <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
| name="jboss.cache:service=TreeCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <!--
| Configure the TransactionManager
| -->
| <attribute name="TransactionManagerLookupClass">mypackage.TxManagerLookup</attribute>
|
| <!--
| Isolation level : SERIALIZABLE
| REPEATABLE_READ (default)
| READ_COMMITTED
| READ_UNCOMMITTED
| NONE
| -->
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <!--
| Valid modes are LOCAL
| REPL_ASYNC
| REPL_SYNC
| INVALIDATION_ASYNC
| INVALIDATION_SYNC
| -->
| <attribute name="CacheMode">REPL_SYNC</attribute>
|
| <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
| cluster in order to find each other.
| -->
| <attribute name="ClusterName">JBossCache-Cluster</attribute>
|
| <!--Uncomment next three statements to enable JGroups multiplexer.
| This configuration is dependent on the JGroups multiplexer being
| registered in an MBean server such as JBossAS. -->
| <!--
| <depends>jgroups.mux:name=Multiplexer</depends>
| <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
| <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
| -->
|
| <!-- JGroups protocol stack properties.
| ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
| -->
| <attribute name="ClusterConfig">
| <config>
| <UDP mcast_addr="228.10.10.10"
| mcast_port="45588"
| 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="2"
| enable_bundling="false"
| enable_diagnostics="true"
|
| use_concurrent_stack="true"
|
| thread_naming_pattern="pl"
|
| thread_pool.enabled="true"
| thread_pool.min_threads="1"
| thread_pool.max_threads="25"
| thread_pool.keep_alive_time="30000"
| thread_pool.queue_enabled="true"
| thread_pool.queue_max_size="10"
| thread_pool.rejection_policy="Run"
|
| oob_thread_pool.enabled="true"
| oob_thread_pool.min_threads="1"
| oob_thread_pool.max_threads="4"
| oob_thread_pool.keep_alive_time="10000"
| oob_thread_pool.queue_enabled="true"
| oob_thread_pool.queue_max_size="10"
| 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"/>
| <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
| retransmit_timeout="300,600,1200,2400,4800"
| discard_delivered_msgs="true"/>
| <UNICAST timeout="300,600,1200,2400,3600"/>
| <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
| max_bytes="400000"/>
| <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
| view_bundling="true" view_ack_collection_timeout="5000"/>
| <FRAG2 frag_size="60000"/>
| <pbcast.STREAMING_STATE_TRANSFER/>
| <!-- <pbcast.STATE_TRANSFER/> -->
| <pbcast.FLUSH timeout="0"/>
| </config>
| </attribute>
|
|
| <attribute name="FetchStateOnStartup">false</attribute>
| <attribute name="InitialStateRetrievalTimeout">5000</attribute>
| <attribute name="SyncReplTimeout">20000</attribute>
| <attribute name="SyncRollbackPhase">true</attribute>
| <attribute name="LockAcquisitionTimeout">15000</attribute>
| <attribute name="UseMarshalling">false</attribute>
| <attribute name="CacheLoaderShared">true</attribute>
| <attribute name="CacheLoaderPreload">/</attribute>
| <attribute name="CacheLoaderPassivation">false</attribute>
| <attribute name="CacheLoaderFetchPersistentState">true</attribute>
| <attribute name="CacheLoaderFetchTransientState">false</attribute>
| <attribute name="CacheLoaderAsynchronous">false</attribute>
| </mbean>
| </server>
The final dependencies are those :
<dependency>
| <groupId>javax.transaction</groupId>
| <artifactId>jta</artifactId>
| <version>1.1</version>
| </dependency>
| <dependency>
| <groupId>jboss.jbossts</groupId>
| <artifactId>jbossts-common</artifactId>
| <version>4.3.0.GA</version>
| </dependency>
| <dependency>
| <groupId>jboss.jbossts</groupId>
| <artifactId>jbossjta</artifactId>
| <version>4.3.0.GA</version>
| </dependency>
| <dependency>
| <groupId>org.jboss.cache</groupId>
| <artifactId>jbosscache-core</artifactId>
| <version>2.1.1.GA</version>
| </dependency>
| <dependency>
| <groupId>oswego-concurrent</groupId>
| <artifactId>concurrent</artifactId>
| <version>1.3.4</version>
| </dependency>
Manik,
I didtn't find where you read this :
anonymous wrote : Note that JBossTS 4.3 provides a JTA 1.1 implementation, whereas JBossAS 4.2 ships the JTA 1.0.1b API files.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163826#4163826
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163826
More information about the jboss-user
mailing list