-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: EJB3 or EJB2+Hibernate?
PostPosted: Thu Dec 29, 2005 3:07 am 
Newbie

Joined: Mon Jun 20, 2005 6:15 am
Posts: 5
Hi,

I'm starting a new project which I wish to use EJB3.
As far as I know the specification of EJB3 is not yet finalised.
If I'm using EJB3 with the current implementation i'm not sure how much changes I need to make after I develop my project halfway.

The other idea would be using EJB2(Session) plus Hibernate.
But I really hate the EJB2 ideas.

Any suggestion?


Top
 Profile  
 
 Post subject: Loaded Question
PostPosted: Thu Dec 29, 2005 11:14 pm 
Regular
Regular

Joined: Sat Jan 22, 2005 6:57 pm
Posts: 50
Location: Chicago
Topic comes up quite often in Java User Groups.

As of today, December 2005, there are some companies who are actually using EJB3 in production enviornments. I would be leary of this since the spec is not quite finished. But since some EJB3 containers (like JBOSS) are essentially Hibernate under the hood, then go with EJB3 if your system is not going to be mission critical for the next 6 to 8 months.

If you need to write something for production and it needs to be ready and stable for general release in the next few months, you should lean towards EJB2 + Hibernate.

Having said that, if you do not use EJB3, you will eventually need to do some Hibernate to EJB3 porting unless you want to maintain separate APIs.

I'm sure some will agree, others disagree. But that is what we found.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 9:48 pm 
Newbie

Joined: Mon Jun 20, 2005 6:15 am
Posts: 5
markricard,

my system would take at least 6 months to be built before being sent to QA. Or at least it need 1 year for a completion.

I've never used Hibernate but I like the idea of ORM very much.
As I look into the EJB3 specs it looks just great and it turns me off using EJB2 mechanism.

As there are not enough sufficient books describing EJB3 entity beans, it would be a dilemma when I am unable to find the answer for certain database mapping. As for Hibernate I can always refer to Hibernate in Action book.

So now my choices come down to:
#1. EJB3(Session Bean)+ Hibernate
#2. EJB3(Session Bean) + EJB3(Entity Bean)

Unless the EJB(Entity Bean) mapping is very similiar to Hibernate I might just be using EJB3(Entity Bean).

any opinion?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 3:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Map your persistent classes with Hibernate Annotations, use EJB3-compatible annotations whenever possible and Hibernate extensions when needed.

Write your data access code with the EJB3 EntityManager API.

All of this runs in plain JSE and does not require EJBs or an application server. However, seriously consider EJB3 session beans though, they are great. Right now the only tested integration of Hibernate Annotations and Hibernate EntityManager is with JBoss EJB3 Application Server. Others will definitely follow.

Wait a few weeks until both Hibernate Annotations and Hibernate EntityManager, and JBoss EJB3, have been updated to the latest Public Final Draft of EJB3 that just came out. Use the time to learn the spec and Hibernate stuff.

Comparable examples of XML mappings and annotations, the most time-consuming issue you will face, can be found in http://caveatemptor.hibernate.org/ - I recommend staying up-to-date with CVS there.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 4:48 am 
Newbie

Joined: Mon Jun 20, 2005 6:15 am
Posts: 5
Christian,

excellent. This is exactly the reply I wanted.
I'll explore more for time being on annotation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.