[JBoss Seam] - Nested conversations clarrification
by lcoetzee
Hi,
I have been playing around with nested conversations and ran into an iteresting situation. I would like to try and clarify my understanding...
I have a conversation with some outjected variables e.g. an oujected variable : "component".
1.
When I start a nested conversation (@Begin(join=true)) I have access to the outjected variable "component".
2. If I would change the value of this outjected "component" it now becomes part of the inner conversation
2.1 and as a result gets destroyed when this nested conversation ends (@End) ? or
2.2 and as a result becomes available to the outer conversation with the value that it received during the nested inner conversation (it does not get destroyed)?
3. When returning to outer (initial) conversation the previously outjected "component" is
3.1 not available because of 2.1 (is null and can be reinstantiated with a Factory for instance) ? or
3.2 is available with the new value it received during the nested coversation ?
My feeling is that 2.1 and 3.1 is most likely what is supposed to happen ? Is that correct ?
Thanks
Louis
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963098#3963098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963098
19 years, 9 months
[JBossCache] - TreeCache performance with 1, 000, 000 nodes
by confuz
Hi,
For currently evict policy only support node level. so I use one onde to store one object. but I hit some problem when implement that.
Had anyone tried put 1,000,000 nodes in TreeCache. when using JDBC cache loader(local mysql database), the performance is quite poor while BdbjeCacheLoader is good for previout 400,000.
after that, the program will hang.
is there any limitation of max nodes of treecache or i miss something ?
| package org.jboss.cache.passivation;
|
| import java.io.Serializable;
| import java.util.Properties;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.transaction.UserTransaction;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.cache.CacheException;
| import org.jboss.cache.Fqn;
| import org.jboss.cache.PropertyConfigurator;
| import org.jboss.cache.TreeCache;
| import org.jboss.cache.loader.CacheLoader;
| import org.jboss.cache.loader.SamplePojo;
|
| public class TestPassivation1 {
|
| TreeCache cache = null;
| CacheLoader loader = null;
|
| /**
| * @param args
| */
| public static void main(String[] args) throws Exception {
| TestPassivation1 tester = new TestPassivation1();
| tester.start();
| long start = System.currentTimeMillis();
| tester.test1();
| System.out.println("/test/0" + tester.cache.get(Fqn.fromString("/test/0"),"0"));
| tester.print(10);
| Thread.sleep(10000);
|
| System.out.println("/test/1" + tester.cache.get(Fqn.fromString("/test/1"),"1"));
| tester.print(10);
|
| long end = System.currentTimeMillis();
| System.out.println(end - start);
|
| tester.stop();
| }
|
|
|
| private void test1() throws Exception{
| long start = 0;
| long end = 0;
| start = System.currentTimeMillis();
| for(int j = 0; j < 100000; j ++){
| cache.put("/test/" +(j) ,"" + j,"Object" + j);
| }
| end = System.currentTimeMillis();
| System.out.println("cost :" + (end-start));
| for(int j = 0; j < 1000; j ++){
| start = System.currentTimeMillis();
| for(int i = 0; i < 1000; i ++){
| cache.put("/test" + j + "/" +(i) ,"" + i,"Object" + i);
| }
| end = System.currentTimeMillis();
| System.out.println("cost " + j + ":" + (end-start));
| // if(j % 20 == 0){
| // System.gc();
| // }
| }
|
| }
|
| private void print(int count) throws Exception{
| for(int i = 0; i < count; i ++){
| System.out.println("Cache exists [/test/" + i + "]:" + cache.exists("/test/" + i));
| }
| for(int i = 0; i < count; i ++){
| System.out.println("Loader exists [/test/" + i + "]:" + loader.exists(Fqn.fromString("/test/" + i)));
| }
| }
|
| private void start() throws Exception{
| cache = new TreeCache();
| PropertyConfigurator pc = new PropertyConfigurator();
| pc.configure(cache, "META-INF/tree-service1.xml");
|
| cache.createService();
| cache.startService();
| loader = cache.getCacheLoader();
|
| }
|
|
| private void stop() throws Exception{
| cache.remove("/");
| loader.remove(Fqn.fromString("/"));
| cache.stopService();
| cache.destroyService();
| }
|
| }
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!-- ===================================================================== -->
| <!-- -->
| <!-- Sample TreeCache Service 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.DummyTransactionManagerLookup</attribute>
|
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <attribute name="CacheMode">LOCAL</attribute>
|
| <attribute name="ClusterName">TreeCache-Cluster</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">5</attribute>
| <!-- Cache wide default -->
| <region name="/_default_">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">5</attribute>
| </region>
| <region name="/org/jboss/data">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| <region name="/test">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">3</attribute>
| <attrubute name="maxAgeSeconds">0</attrubute>>
| </region>
| </config>
| </attribute>
|
| <!--
| <attribute name="CacheLoaderConfiguration">
| <config>
| <passivation>true</passivation>
| <preload></preload>
| <cacheloader>
| <class>org.jboss.cache.loader.JDBCCacheLoader</class>
|
| <properties>
| cache.jdbc.table.name=jbosscache
| cache.jdbc.table.create=true
| cache.jdbc.table.drop=true
| cache.jdbc.table.primarykey=jbosscache_pk
| cache.jdbc.fqn.column=fqn
| cache.jdbc.fqn.type=char(255)
| cache.jdbc.node.column=node
| cache.jdbc.node.type=blob
| cache.jdbc.parent.column=parent
| cache.jdbc.driver=com.mysql.jdbc.Driver
| cache.jdbc.url=jdbc:mysql://localhost/Discuz
| cache.jdbc.user=root
| cache.jdbc.password=
| </properties>
| <async>false</async>
| <fetchPersistentState>false</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
|
| <purgeOnStartup>false</purgeOnStartup>
| </cacheloader>
| </config>
| </attribute>
| -->
|
|
| <attribute name="CacheLoaderConfiguration">
| <config>
| <passivation>true</passivation>
|
| <shared>false</shared>
|
| <cacheloader>
| <class>org.jboss.cache.loader.bdbje.BdbjeCacheLoader</class>
| <properties>
| location=c:/tmp/filetore1
| </properties>
| <async>false</async>
|
| <fetchPersistentState>false</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
| <purgeOnStartup>false</purgeOnStartup>
| </cacheloader>
|
| </config>
| </attribute>
|
| </mbean>
|
|
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963090#3963090
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963090
19 years, 9 months
[Clustering/JBoss] - Re: HA-JNDI in Cluster on 1 machine?
by mroosendaal
I tried deploying a simple MDB on a 2 node cluster on a multihomed machine. I followed the instructions according to the wiki-page (http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstance...). deployment on the masternode works fine but when the deployment on the second node gets pulled i get:
2006-08-04 07:58:44,787 INFO [org.jboss.ejb.EjbModule] Deploying SpGBerichtDispatcherMDB
2006-08-04 07:58:45,476 WARN [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected:
org.jboss.deployment.DeploymentException: Error during queue setup; - nested throwable: (javax.jms.InvalidDestinationException: The destination QUEUE.lo3_queue does not exist !)
at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:39)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:898)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:922)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
......
What i did was the following:
changed conf/jboss-service.xml to enable clustering (node = ports-01, node2 = ports-02)
|
|
| | changed deploy/cluster-service.xml on the second node (we use 4.0.2 and has a bug concerning port 4446) and used 4447.
|
|
| | added bind_addr in both cluster-service.xml's
|
|
| | added our own jms.xml to deploy-hasingleton/jms (and we see the queue on the masternode.
| |
|
| What am i missing? Did i forget to change a setting. I also tried changing the hajndi-jms-ds.xml on both nodes to the corresponding port but no luck either.
|
| Hope someone can help!
|
| Thanks,
| Maarten
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963089#3963089
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963089
19 years, 9 months