views:

1148

answers:

5

I am a newbie trying to figure out the pros and cons of using Hibernate with Tomcat and with JBoss.

I am developing a web application with Flex at the front-end, BlazeDS as the messaging service and Java at the back-end. We have decided on using Hibernate as the persistence mechanism but would like to know the trade-offs of using it with Tomcat and JBoss.

Thanks.

+1  A: 

I believe JBOSS EJB3 is using Hibernate as its JPA implementation. Hibernate is also embedded into Seam. And JBOSS uses Tomcat as its servlet/JSP engine, so your comparison isn't "either/or".

If done properly, your choice of Flex should not know or care about how you persist things. That should be hidden from the client by the messaging interface.

duffymo
A: 

It shouldn't make a difference. You could use Hibernate with both.

Having said that, I would recommend using it with JBoss, since it comes installed OOB and you won't need to configure your application server specially to use Hibernate.

Also, consider using JPA (EJB3). If you use JBoss, you will use Hibernate under the hood and you'll benefit from using a more general Java EE standard.

Pablo Santa Cruz
You can choose to use JPA (and no Hibernate extensions) via Hibernate EntityManager, with or without JBoss. Using JBoss _just_ for Hibernate is overkill.
ChssPly76
Yes, but he also needs a Servlet Container. And one APP Server WITH Hibernate AND a Servlet Container configured out of the box, is JBoss...
Pablo Santa Cruz
+4  A: 

Tomcat is JBoss's servlet engine, so you'll be using Tomcat regardless.

I would go for JBoss in your case. It already come with Hibernate, saving you the need to bundle Hibernate in your application. JBoss comes pre-configured with multiple different profiles, so you can pick the profile that does what you need without having much in the way of baggage (i.e. you can safely ignore all the heavy JavaEE stuff). Equally, if your application need to start using more JavaEE stuff (e.g. web services, EJB3), you can easily bring those JBoss services in.

Incidentally, you might want to look at GraniteDS as an alternative to BlazeDS, it seems to be a better piece of software.

skaffman
A: 

Use JPA with Hibernate as your JPA implementation on Tomcat. This is simpler and simpler is usually better. You can easily "upgrade" to the more complete stack offered by JBoss should you need to as it uses Tomcat as its servlet container.

David Tinker
A: 

something like 70% of java server apps are developed on Tomcat.

Hein B