• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

is hibernate a alternative for Entity bean??

 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just curious.
 
author
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB containers provide entity bean pooling and I don't think hibernate pools objects. :roll:
 
Gavin King
author
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ?
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Easier maybe. But if we accept that JVM pools memory better better than container pools and our goal is performance, than ... :-).

./pope
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Gavin King
author
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please check this:
Hibernate2 with Weblogic and so the 20% is solved ;-).

./pope

PS: benefit of on open-source
 
Gavin King
author
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lots of people use Hibernate inside WebLogic, there is no problem with this combination ;-)
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic