-->
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: Hibernate and EJB
PostPosted: Wed Oct 15, 2003 4:51 am 
Beginner
Beginner

Joined: Thu Oct 02, 2003 8:02 am
Posts: 45
I'd like to use hibernate with EJB.
I see that there's 2 categories of EJB : EJB Entity and EJB Session.
For each category, there's 2 sub-categories.
EJB Entity : BMP and CMP
EJB Session : stateless and statefull
I'd like to know the EJB's category that i can use with hibernate. As i understand, only EJB Entity deal with DataBase. So i deduct that we can't use hibernate with EJB Session.
Can someone helps me and explains to me the best way to do such an integration.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 4:58 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You can use Hibernate as a persistence mechanism for Entity Beans with BMP. You can of course use Hibernate and plain JavaBeans with SessionBeans (the recommended approach). Please start reading some basic J2EE documentation and books.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 4:59 am 
Beginner
Beginner

Joined: Thu Oct 02, 2003 8:02 am
Posts: 45
Just another thing. Is it possible to substitute EJB by hibernate ?
I don't understand exactly if these 2 technologies are equivalent or complementary?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 5:00 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Both.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 8:49 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
To be short
EJB session have no special link to DB.
It allows remote access, declarative transaction management, clustering, etc

EJB Entity map object world and Relational DB world, as Hibernate does. So yes EJB Entity and Hibernate do the same job

Entity pros:
- standard
- remote access (sorry must be a typo ;-))
- object pooling
- ...

Hibernate/JDO Pros:
- Entity are too Heavy
- no clear separation between object model and mapping mecanism
- can be used outside a J2EE container
- ...

So yes Hibernate and EJB are complementary

I personally use EJB Session and behind hibernate (no EJB Entity)


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.