aspose file tools*
The moose likes Object Relational Mapping and the fly likes is hibernate a alternative for Entity bean?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "is hibernate a alternative for Entity bean??" Watch "is hibernate a alternative for Entity bean??" New topic
Author

is hibernate a alternative for Entity bean??

Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
Just curious.


Kishore
SCJP, blog
Gavin King
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 76
yes.


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/193239415X/ref=jranch-20" target="_blank" rel="nofollow">Hibernate in Action</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
yes, and have another Persistence Framework like Hibernate as

Hibernate isn't the only framework available for mapping objects to persistent data stores. I encourage you to evaluate each of them and choose the best one for your needs. Some alternative frameworks, listed in no particular order, are:

1. OJB. "ObjectRelationalBridge (OJB) is an Object/Relational mapping tool that allows transparent persistence for Java Objects against relational databases." Apache license. http://db.apache.org/ojb/

2. Castor. "Castor is an open source data binding framework for Java[tm]." BSD-like license. http://castor.exolab.org/

3. CocoBase. "CocoBase� offers a simple to use, powerful Dynamic Object to Relational Mapping� tool for Java developers writing applications on the J2EE, J2SE and J2ME platforms." Commercial. http://www.thoughtinc.com/cber_index.html

4. TopLink. "With TopLink, developers can map both Java Objects and Entity Beans to a relational database schema." TopLink was recently purchased by Oracle. Commercial. http://www.oracle.com/features/9iAS/index.html?t1as_toplink.html


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

EJB containers provide entity bean pooling and I don't think hibernate pools objects. :roll:


Groovy
Gavin King
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 76
Instance pooling is a misfeature, actually. Your JVM can pool memory much more effectively than your application server can, and you shouldn't acquire references to heavyweight resources in entity objects.

(The original EJB specs were written when Java garbage collection was much more expensive than it is today.)
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Gavin King:
Instance pooling is a misfeature, actually. Your JVM can pool memory much more effectively than your application server can, and you shouldn't acquire references to heavyweight resources in entity objects.

(The original EJB specs were written when Java garbage collection was much more expensive than it is today.)


Ok, The server can be acquired memmory when run server , So

Can i see detail of environment was acquired?
How to config about memmory size for server ?
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
AS Gavin said it is about the JVM configuration. Every available virtual machine can offer its set of parameters to configure (for example see Sun JVM - Tuning Garbage Collection articles).

./pope


blog - InfoQ.com
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Ali Pope:
AS Gavin said it is about the JVM configuration. Every available virtual machine can offer its set of parameters to configure (for example see Sun JVM - Tuning Garbage Collection articles).

./pope


Is n't it easier to configure the container than JVM?
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Easier maybe. But if we accept that JVM pools memory better better than container pools and our goal is performance, than ... :-).

./pope
Fabrizio Gianneschi
Ranch Hand

Joined: Nov 29, 2001
Posts: 70
I tend to prefer Hibernate simplicity when mapping domain objects than focusing into performance issues.

POJOs and a bit of xml are FAR simpler to code and mantain than ejb's home/local/remote interfaces and architecture. You've to add the complexity of the container, too.


Fabrizio Gianneschi<br />SCPJ2, SCWCD, SCBCD
Gavin King
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 76
The memory acquired by your domain model objects is just a tiny fraction of the total memory usage of the server. Your JDBC driver, JSP engine, etc, are spewing out way more garbage than Hibernate is. So trying to control memory allocation by adjusting pool size for domain objects is unlikely to be very successful in real applications.
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
If it is difficult to get it working with some major application servers(like Weblogic), what is the point in using Hibernate??
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
If it is difficult to get it working with some major application servers(like Weblogic), what is the point in using Hibernate??


From where is this coming? Hibernate fully integrates with JBoss, WebSphere (there are also documents on this) and WebLogic (underwork if I am not wrong) - so the major AS. Check the wiki part of Hibernate site and you will get all the info needed to make it work.

./pope
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
Originally posted by Ali Pope:


From where is this coming? Hibernate fully integrates with JBoss, WebSphere (there are also documents on this) and WebLogic (underwork if I am not wrong) - so the major AS. Check the wiki part of Hibernate site and you will get all the info needed to make it work.

./pope


One of the other posts in the forum says that it is not easy and there are problems while working with weblogic(ie about 20% of app server market right)
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Please check this:
Hibernate2 with Weblogic and so the 20% is solved ;-).

./pope

PS: benefit of on open-source
Gavin King
author
Ranch Hand

Joined: Aug 31, 2004
Posts: 76
Lots of people use Hibernate inside WebLogic, there is no problem with this combination ;-)
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

From where is this coming? Hibernate fully integrates with JBoss, WebSphere (there are also documents on this) and WebLogic (underwork if I am not wrong) - so the major AS.


We are using Jboss app server and Hibernate works smoothly. Does Jboss entity beans use Hibernate as persistent layer for entity beans? I am not clear what do they mean by usinh Hibernate as persistent layer.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Pradeep Bhat:


We are using Jboss app server and Hibernate works smoothly. Does Jboss entity beans use Hibernate as persistent layer for entity beans? I am not clear what do they mean by usinh Hibernate as persistent layer.



Yes, entity can use Hibernate BUT it's bad performance.(More overhead).

I'm use session bean(SEssion Facade) to call/manage hibernate persistent.

BUT in web application such as E-commerce website.. etc , i'm use Hibernate instead DAO.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is hibernate a alternative for Entity bean??