[JBossCache] - how to support treecache transaction in CMT
by confuz
Dear All,
I used TreeCache 1.4.0.GA and Jboss 4.0. currently need to support cache transaction in CMT. in the session bean method, the db operation will be rollbacked while cache operation won't when exception is threw.
how to support cache transaction in cmt?
Thanks for any help.
code sample in session bean
| try{
| dboperation
| cacheoperation
|
| }catch(Exception e){
| sessionContext.setRollbackOnly();
| CCException ee = handleSQLException(e) ;
| throw ee;
| } finally {
| closeConnection(this.getClass().getName(), dbConn);
| }
|
configuration
| <server>
|
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
|
|
| <!-- ==================================================================== -->
| <!-- Defines TreeCache configuration -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.cache.TreeCache"
| name="jboss.cache:service=testTreeCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
| <attribute name="UseReplQueue">false</attribute>
|
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.GenericTransactionManagerLookup</attribute>
|
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <attribute name="CacheMode">LOCAL</attribute>
|
| <attribute name="ClusterName">TreeCache-Cluster</attribute>
|
| <attribute name="ClusterConfig">
| <config>
| <UDP mcast_addr="228.1.2.5" mcast_port="45577"
| ip_ttl="64" ip_mcast="true"
| mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
| ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
| loopback="false"/>
| <PING timeout="2000" num_initial_members="3"
| up_thread="false" down_thread="false"/>
| <MERGE2 min_interval="10000" max_interval="20000"/>
| <FD shun="true" up_thread="true" down_thread="true"/>
| <VERIFY_SUSPECT timeout="1500"
| up_thread="false" down_thread="false"/>
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
| up_thread="false" down_thread="false"/>
| <pbcast.STABLE desired_avg_gossip="20000"
| up_thread="false" down_thread="false"/>
| <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
| down_thread="false"/>
| <FRAG frag_size="8192"
| down_thread="false" up_thread="false"/>
| <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
| shun="true" print_local_addr="true"/>
| <pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
| </config>
| </attribute>
|
| <attribute name="InitialStateRetrievalTimeout">20000</attribute>
|
| <attribute name="SyncReplTimeout">15000</attribute>
|
| <attribute name="LockAcquisitionTimeout">10000</attribute>
|
|
| <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">3</attribute>
| <!-- Cache wide default -->
| <region name="/_default_">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| <region name="/org/jboss/data">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| <region name="/test">
| <attribute name="maxNodes">500</attribute>
| <attribute name="timeToLiveSeconds">0</attribute>
| <attrubute name="maxAgeSeconds">0</attrubute>>
| </region>
| </config>
| </attribute>
| </mbean>
|
|
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966351#3966351
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966351
19 years, 8 months
[JBossCache] - Re: JBossCacheIDE 1.0 Released
by gurkanerdogdu
Ben, I explained all the nifty details about the usage of ide in the JBoss Cache IDE user documentation that I have sent you :). Anyway I like to try answer your questions quickly :)
anonymous wrote :
| 1. I can create the node on the "Cache Config" pane. But how do I add the key, value pair? "Show Content" seems to be read only.
|
Creating the local cache instances in the pane and playing with operations on it as locally (Start/Stop/Add new Node/Remove Node) is provided as experimental just for beginner users of the JBoss Cache . It is not advisable to start this cache instance in the Eclipse environment that join to already exist cache groups. It is there for just getting the idea about the cache operations.
Actually, creating the local cache instance on the cache config pane is used for getting the related cache configuration file as qucikly using the wizard. In other words, you could create the cache configuration file using wizard, view the cache config file with open editor on it and play with attributes qucikly.
This ide is used for visualizing the cache content running on the remote server. So with creating remote cache instances in the Eclipse environment, you could able to view cache content as read only. This is the main point of using this ide.
anonymous wrote :
| 2. In cache.cgf.xml pane, "Design" tab means what? It seems to me you are just showing bunch of xml tak and attributes.
|
If you open the cache config file with cache editor, you see the editor with two tab : Design and Source. Design tab is used for viewing the structure of the document, and source is the actual XML file. You can insert/update operations to the XML file with supplying content assistant processor that I explained in the user documentation.
anonymous wrote :
| 3. Finally, and most importantly, how do I use PojoCache and display it? I see that you have a object graph view. That is very teasing. :-)
|
I explained the usage of this in also user doc :) But as a quick answer, the object graph is just give the classes of the objects in the cache nodes.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966345#3966345
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966345
19 years, 8 months