Re: EJB 3.0 vs Spring



On Thu, 28 Sep 2006 16:04:55 +0100, Steve <x@xxxxx> wrote:

I am considering using EJB 3.0 with an Application Server (e.g. JBoss) or Spring with a Web Server (e.g., Tomcat). In either case, I
plan to use Hibernate. What are the major pros and cons of each approach?

I think that Rod Johnson's advice to use EJB if you need distributed objects (i.e. if you *really* need distributed objects and can justify that need) and avoid it if you don't is broadly sensible. EJB3 has improved things greatly, particularly with entity beans, but it still might be a bit early to depend on it. The JBoss implementation is in beta (beta 8 no less) and is buggy. The JBoss website has the following disclaimer:

"NOTE: JBoss EJB3 is not a final implementation and it does not pass the EJB3 Compatibility Test Suite."

My experience with JBoss + Hibernate + EJB 3.0 was OK until I hit a bug that required an upgrade that quickly descended into a mess of seemingly irreconcilable inter-dependencies.

Furthermore, Sun currently don't seem comfortable recommending their Java EE 5 offering (Sun AS 9) over their J2EE 1.4 offering (Sun AS 8.2). BEA WebLogic might be a better bet but it's not cheap.

You can use the Hibernate JPA EntityManager outside of an application server, which might be the way to go. You still get to take advantage of all of the entity annotations.

Dan.

--
Daniel Dyer
http://www.uncommons.org
.



Relevant Pages

  • JBoss, PostgreSQL, XDoclet, Serial primary keys in CMP
    ... I'm trying to get a simple container managed bean to work with JBoss ... assuming you know what you're doing) of getting a data access layer. ... I've also looked at Hibernate, but wonder about my Hibernate classes ... was with Data Access Object, but with added features such as versioning. ...
    (comp.lang.java.programmer)
  • Re: CMP without entity beans ?
    ... JBoss), so i've started studying "JBoss at work, a practial guide". ... the CMP chapter uses Hibernate ... instead of Entity Beans. ...
    (comp.lang.java.programmer)
  • MappingException with Hibernate and JBoss
    ... I am running JBoss 3.2.5 and have gone through all the tutorials that I ... least some of the Hibernate classes are accessible (they are being ...
    (comp.lang.java.databases)
  • (Spring/Tapestry)-POJOs-hibernate-oracle-JBOSS
    ... I am not using EJB i am using POJO's then why do I go for JBOSS instead ... what is the advantage of O/R mapping provided by hibernate what are all ... what is the best thing for front end java script validations in model ...
    (comp.lang.java.help)
  • (Spring/Tapestry)-POJOs-hibernate-oracle-JBOSS
    ... I am not using EJB i am using POJO's then why do I go for JBOSS instead ... what is the advantage of O/R mapping provided by hibernate what are all ... what is the best thing for front end java script validations in model ...
    (comp.lang.java.help)