View Full Version : JBoss/Spring/Hibernate
Nov 19th, 2004, 08:00 PM
We are planning to redesign a legacy system developed using mainly stored procedures on Oracle. This is a complex application with large no. of tables (~100) and is extensively used (~400 concurrent users max).
Until last week, we thought that we are going to use JBoss/Hibernate/Oracle to develop this application. This is NOT a web application. We'll develop a OS X specific client. Just last week end, i came across Spring and it sound very interesting to me. I'm exploring the possibility of using Spring in this project and have the following questions.
1. Per my understanding, spring is providing various J2EE features (except clustering?? ) but still need a container to run my application. As our application is NOT web based, we need an application server, in our case, JBoss. If we choose to use spring/hibernate in our project and deploy that application on JBoss, will i use the services/featurs offered by JBoss (which a j2ee container by itself) or Spring?
2. Do i have a choice of which features to use from Spring/JBoss?
3. If yes, how do control it?
4. In the above scenario, assuming that, i 'm using all the features of Spring, can i choose to use just Clustering features provided by JBoss? Will there be any clash in this case?
6. In this case, is JBoss not a overhead?
7. Has anyone deployed spring/hibernate application on JBoss? If yes, i would greatly appreciate, if you could share your thoughts/experience here.
I greatly appreciate any inputs on this.
Nov 20th, 2004, 03:57 PM
A fairly extensive discussion of load balancing options related to Spring can be found at http://forum.springframework.org/showthread.php?t=11351. Whether your end clients are rich clients or MVC client isn't really a big issue. We routinely run a web server with a WAR that provides only web services end points to rich clients (there are no MVC clients). It's perfectly normal and safe to do this. Check out the Petclinic sample in the Spring Rich subproject CVS to see this in action via Java Web Start.
You only need JBoss if you need:
- Transparent RMI based clustering (ie HttpInvoker is insufficient, which would be odd - check out the compataive performance via the JPetStore "client" directory application and you'll see it's quite competitive)
- You need distributed transactions across multiple databases and you don't want to just use a web container compatible provider
- You need transparent propagation of transaction identity as your beans are located across multiple servers (this tends to point to a design problem in 95% of cases, as beans should typically be collocated to avoid serialization)
- You need transparent propagation of security identity as your beans are located across multiple servers (Acegi Security now has support for transparent propagation of security identity via the RMI and HttpInvokers so this probably is no longer a genuine reason alone to use JBoss)
- You need one of JBoss' exotic features (I don't know what they are, but someone will probably chime in and say if I forgot one so this is a catch-all) :-)
Honestly, a WAR in a web server with collocated beans using HttpInvoker and a hardware (or software) HTTP-based load balancer will typically be perfect for most projects.
Nov 20th, 2004, 07:05 PM
Thanks Ben for your response.
Our app will NOT have:
1. Distributed Txns
2. Distributed beans
Now that i told you what i don't need, we DO NEED the following:
1. Caching mechanism.
2. Control the access of various objects based on their rolls (i'm yet to read the acegi security implementation)
I was thinking for JBoss for the following reasons:
JBossCache (most likely, i need JBoss TreeCacheAOP) They say that it integrates well with Hibernate Second level cache.
In this scenario, if i deploy spring/hibernate app on JBoss, can i just choose to use JBossCache? What are the other options i've?
Nov 21st, 2004, 02:26 PM
Hibernate is compatible with several caching layers.
SwarmCache is a cluster-aware cache. Accordingly to page 184 of "Hibernate In Action", SwarmCache is supports read-only and nonstruct-read-write concurrent strategies. JBossCache supports read-only and transactional strategies.
Perhaps SwarmCache would suit your needs. You'd need to look into whether you can use JBoss' caching layer without JBoss. The Hibernate forums might be a better place to investigate this Hibernate-specific issue.
Given the remainder of your requirements, I certainly wouldn't be using JBoss.
Nov 21st, 2004, 02:54 PM
So, Ben, you are saying that, given my requirements, if i use web server (say tomcat) and implement my application that's using Spring/Hibernate and JBossTreeCacheAOP or SwarmCache or some other cache plugin, it would be enough and no JBOss??
Nov 21st, 2004, 03:09 PM
One other things. Load balancing and clustering are two things. Load balancing is required to redirect the request to a different server automatically. Clustering is when one server goes down, the standby should become the primary server and should happen almost seamlessly to the client.
In our case, we would like to have both options, as our application is mission critical. As we are only redesigning the existing legacy application, currently, we use some hardward based loadbalancing solution and no-clustering.
As you said, software based load balancing might be an overkill and less performing vs h/w based and i prefer that.
But clustering is something that app server offers and JBoss/other app servers have those features. If i choose NOT TO USE JBoss, what other options i've for clustering?
Or my understanding about load-balancing/clustering is completely incorrect? :)
Nov 21st, 2004, 03:10 PM
You've got no distributed transactions (which you could deal with in a web container if needed), and no distributed beans (which unless you need transparent transaction propagation to the remote server, again you could do this in a web container if needed). Your only potential JBoss requirement is for Hibernate caching, and then you have a choice of about four plugins. In a clustered environment there are practical limitations with caching due to transaction isolate anyway (generally TRANSACTION_SERIALIZABLE is used on the JDBC driver), so you'll need to carefully consider the finer points of Hibernate caching in a cluster. As I don't want to give you incorrect information on this topic, I'd suggest you review some of the Hibernate-specific material and forums.
Nov 21st, 2004, 03:25 PM
Thanks Ben. I'll explore this further in Hibernate forum.
Sep 26th, 2011, 09:12 AM
Sample Application to Integrate Spring, Hibernate and JBoss
Nov 21st, 2011, 11:21 AM
that is very nice effort, it will really help all of us out :)
Buy Mobile Phones (http://www.onlinebazaar.pk)
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.