-
Dec 18th, 2007, 12:28 PM
#1
Spring and JBoss
Hi, I've been doing some research on application servers (specifically JBoss since I have used it in the past) and I'm wondering why I would want to use the overhead of a heavyweight application server, such as JBoss, when I can simply use a lightweight container like spring and use tomcat for my JSPs. It seems like (in one way or another) Spring offers the major features of an app server, such as transactions and database layers.
Is there a reason for a large scale application, such as a banking application, I would use an app server instead? Thanks.
Jeff
-
Dec 19th, 2007, 03:55 AM
#2
Spring offers a lot but it doesn´t replace an application server, it works very well with it. Especially if you are in the realm of distributed transactions (JTA), container managed DataSources etc. If you don't have need for all that stuff you might be satisfied by Tomcat (I used it for a few products and it works great).
Also most application servers provide an implementation of the full J2EE specifications, whereas tomcat 'only' implements the Servlet and Jsp specifications.
-
Dec 19th, 2007, 04:00 AM
#3
Clustering and a good management console is also a place where Tomcat doesnt do as well as other big players ...
-
Dec 19th, 2007, 07:39 AM
#4
Thanks for the responses! I have a couple of follow-up questions to that:
In terms of container managed data sources, doesn't Spring have support for that (at least for configuring a database and connecting to it via Hibernate)?
Also, is it common to use an app server such as JBoss AND Spring so you have the ability to configure your POJOs in XML, rather than using EJB3 and annotations? Or even using a combination of spring beans and EJBs (maybe using entity beans and JBoss data source management)?
Thanks again,
Jeff
-
Dec 19th, 2007, 08:01 AM
#5
It is very common to use Spring and jboss. In my last project, it was Spring and WebLogic. Personally, I am not a big fan of EJB, so I tend to use Spring with Hibernate and annotations (or iBatis). But I would still use the container to manage the database connections pool.
It is of course possible to use Spring and EJB, or Spring and "almost any imaginable persistence layer".
-
Dec 19th, 2007, 08:37 AM
#6
Thanks again. I only keep referencing JBoss since that's really the only app server I have used before (aside from Tomcat). In terms of using WebLogic, does WebLogic have the concept of an entity bean? If so, is it just a POJO (that can be constructed in Spring and then configured to be an entity through some WebLogic config files) or does it work some other way? Thanks!
-
Dec 19th, 2007, 08:42 AM
#7
As I said, I am not a big fan of EJBs, and I'm far from an expert on the subject. But WebLogic is a full featured J2EE container, with support for EJB.
I just prefer to use Spring / Hibernate for that part ...
-
Dec 19th, 2007, 08:44 AM
#8
Ah, then maybe I should rephrase. Does Spring/Hibernate have the concept of "entities" such that a POJO and it's fields can be mapped back to a database and automatically update the database (like EJB's entity beans)?
-
Dec 19th, 2007, 09:00 AM
#9
Spring not directly, but that's the role of Hibernate or iBatis. And yes, Spring has support for Hibernate and iBatis. Most people probably use Spring with Hibernate ...
-
Dec 19th, 2007, 09:17 AM
#10
That makes sense.
You mentioned you're not a big fan of EJBs. Could you provide some insight into why that is? I've used them before, and what I like about Spring better is that the configuration of objects via POJOs rather than annotations, but there are pros and cons to that too.
However, as briefly mentioned in previous posts, when it comes to things like distributed database transactions, failover nodes, etc. Will Spring/Hibernate be sufficient? Or would EJB and the app server's persistence layer be more appropriate here?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules