[JBoss Seam] - Performace ISSUES with JBoss Seam, Hibernate and EJB 3.0
by yj4jboss
Hi all,
Around 5 months ago we embarked on a project for one of our major clients. While
doing the design and planning for this project, we came across jboss and some of its
pioneering frameworks such hibernate, seam and the latest ejb 3.0 which was just what we
were looking for. As such, we stared building a web application using these frameworks and
our main aim was to use JBoss Seam and Hibernate to speed up development of the application
using EJB.
While the first phase was hardwork, especially with the initial configs we had to make, we
were satisfied with the way Seam was helping us in the development. Our project structure
is as follows:
Models - Entity Beans generated using Hibernate Tools with Annotations
Controllers - This part consisted of two layers :
- One layer for DataAccessObjects which consisted of SLSB and is aimed at
containing all hibernate specific code that return entities
- Another layer for Actions which consisted of SLSB and SFSB and is aimed at
interacting with the View layer
View - All JSF/Facelet components
Our approach was to have the the view model fetching information from the Action Layer
which in turn calls the DAO layer when querying DB
We were not too familiar with CONVERSATIONS at that time and implemented our SFSB without
this feature.
While the above approach works fine, we are getting some performance related issues :
(1) We get Out of Memory Leaks related to the PermGen Space. We have managed to have a
workaround for this by increasing the MaxPermGen size. However, we fear this might only be
a temporary fix
(2) The application is really slow because of the amount of Session beans that are involved
in it and the amount of code that hibernate autogenerates when fetching dependencies. There are no heavy graphics involved.
We would like to know if the above problems can be solved by :
(a) Implementing conversations ( Will this improve response time)
(b) Porting the application to Tomcat running embedded-ejb can improve the response time
Any other suggestions are also most welcomed.
We are on a tight deadline and would really appreciate any help on this from you experts.
Best Regards,
Yogesh Jankee,
M-ITC LTD
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012070#4012070
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012070
19Â years, 2Â months
[JBossCache] - Re: Persistent configuration in clustered environment.
by chrismeadows
"victor75" wrote : Thank you for the answer.
|
| I have one problematic scenario.
| There're two instances in my clustered environment: "serverA" and "serverB", at the beginning both of them are alive.
| step 1. shutdown the "serverA"
| step 2. make a change in "serverB".
| step 3. shutdown the "serverB"
| step 4. start the "serverA"
| step 5. start the "serverB".
|
| The problem is that a change in step 2 was lost.
|
| Is there any solution here?
|
| Victor.
I've tried to do this as well with JBC 1.4.1, and I am using a cache loader as per Manik's suggestion, but I still get the same problem as Victor - changes to serverB are lost.
So I thought I'd go back and look at the JUnit tests and run them. The one I am interested in is
| build one.test.aop50 -Dtest=org.jboss.cache.loader.CacheLoaderWithReplicationTest
|
I've added a test csae like this
| public void testPessSyncReplFailureRecovery1() throws Exception
| {
| cache1.setCacheMode(TreeCache.REPL_SYNC);
| cache2.setCacheMode(TreeCache.REPL_SYNC);
|
| cache1.startService();
| cache2.startService();
|
| Assert.assertNull(cache1.get(fqn, key));
| Assert.assertNull(cache2.get(fqn, key));
|
|
| CacheLoader loader1 = cache1.getCacheLoader();
| CacheLoader loader2 = cache2.getCacheLoader();
|
| TransactionManager mgr = cache1.getTransactionManager();
| mgr.begin();
| cache1.put(fqn, key, "value");
|
| Assert.assertEquals("value", cache1.get(fqn, key));
| Assert.assertNull(cache2.get(fqn, key));
| Assert.assertNull(loader1.get(fqn));
| Assert.assertNull(loader2.get(fqn));
| mgr.commit();
|
| Assert.assertEquals("value", cache1.get(fqn, key));
| Assert.assertEquals("value", cache2.get(fqn, key));
| Assert.assertEquals("value", loader1.get(fqn).get(key));
| Assert.assertEquals("value", loader2.get(fqn).get(key));
|
| cache2.stopService();
|
| mgr.begin();
| cache1.put(fqn, key, "value2");
|
| Assert.assertEquals("value2", cache1.get(fqn, key));
| Assert.assertEquals("value", loader1.get(fqn).get(key));
|
| mgr.commit();
|
| Assert.assertEquals("value2", cache1.get(fqn, key));
| Assert.assertEquals("value2", loader1.get(fqn).get(key));
|
| cache1.stopService();
|
| cache1.startService();
| cache2.startService();
|
| Assert.assertEquals("value2", cache1.get(fqn, key));
| Assert.assertEquals("value2", loader1.get(fqn).get(key));
| Assert.assertEquals("value2", cache2.get(fqn, key));
| Assert.assertEquals("value2", loader2.get(fqn).get(key));
|
| // force clean up
| tearDown();
| }
|
and it fails on the line in bold, indicating that the caches are in synch but that the cache loaders are not. Could somebody explain why please? Shouldn't the cache loaders also be in synch?
I then swapped the order in which cache1 and cache2 are restarted as follows
| public void testPessSyncReplFailureRecovery2() throws Exception
| {
| cache1.setCacheMode(TreeCache.REPL_SYNC);
| cache2.setCacheMode(TreeCache.REPL_SYNC);
|
| cache1.startService();
| cache2.startService();
|
| Assert.assertNull(cache1.get(fqn, key));
| Assert.assertNull(cache2.get(fqn, key));
|
|
| CacheLoader loader1 = cache1.getCacheLoader();
| CacheLoader loader2 = cache2.getCacheLoader();
|
| TransactionManager mgr = cache1.getTransactionManager();
| mgr.begin();
| cache1.put(fqn, key, "value");
|
| Assert.assertEquals("value", cache1.get(fqn, key));
| Assert.assertNull(cache2.get(fqn, key));
| Assert.assertNull(loader1.get(fqn));
| Assert.assertNull(loader2.get(fqn));
| mgr.commit();
|
| Assert.assertEquals("value", cache1.get(fqn, key));
| Assert.assertEquals("value", cache2.get(fqn, key));
| Assert.assertEquals("value", loader1.get(fqn).get(key));
| Assert.assertEquals("value", loader2.get(fqn).get(key));
|
| cache2.stopService();
|
| mgr.begin();
| cache1.put(fqn, key, "value2");
|
| Assert.assertEquals("value2", cache1.get(fqn, key));
| Assert.assertEquals("value", loader1.get(fqn).get(key));
|
| mgr.commit();
|
| Assert.assertEquals("value2", cache1.get(fqn, key));
| Assert.assertEquals("value2", loader1.get(fqn).get(key));
|
| cache1.stopService();
|
| cache2.startService();
| cache1.startService();
|
| Assert.assertEquals("value2", cache1.get(fqn, key));
| Assert.assertEquals("value2", loader1.get(fqn).get(key));
| Assert.assertEquals("value2", cache2.get(fqn, key));
| Assert.assertEquals("value2", loader2.get(fqn).get(key));
|
| // force clean up
| tearDown();
| }
|
and that fails on the line in bold, indicating that the update has been lost completely from cache1. Huh?
Anyone have ideas on how this is supposed to work? Have I misunderstood something? If not, it would be nice if these JUnit tests were included in the JBossCache test suite (and passed, obvs.)
Any input appreciated.
Chris
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012051#4012051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012051
19Â years, 2Â months