Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HIbernate

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Hibernate something you would use to replace an architecture like Struts?
In other words, if we have a struts application, could we re-write it using Hibernate? And would it still run under Websphere or WebLogic?

Does the book provide real world examples of how applications can be made better, faster and lighter?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>Is Hibernate something you would use to replace an architecture like >>Struts?
Hibernate is not a replacement for Struts but an O/R presistence layer that can be used to enhances an architecture.

>>In other words, if we have a struts application, could we re-write it >>using Hibernate? And would it still run under Websphere or WebLogic?

Also, Struts application that are wrote to use Hibernate will run Websphere or Weblogic.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think of using hibernate as a layer between your application and database.
Using hibernate is independent of which appl. server you use.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if I'm over-stepping your intend question - but there are other open source frameworks that fill the same niche as Struts. For example WebWork, Tapestry and Spring. See:

https://webwork.dev.java.net/
http://jakarta.apache.org/tapestry/
http://www.springframework.org/
 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by anand malu:
Think of using hibernate as a layer between your application and database.
Using hibernate is independent of which appl. server you use.



So hibernate is an alternative to Entity Bean, right?
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is Hibernate something you would use to replace an architecture like Struts?



No , never.

Hibernate is OR-mapping for persistent data susch as RDBMS. (Data Layer)

Struts Framework is web framework which it's support MVC. (Web Layer)

you can integrated both together.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So hibernate is an alternative to Entity Bean, right?



Yes, all right.

You can replace Entity bean with hibernate.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

would it still run under Websphere or WebLogic?



Yes, you can install/run hibernate and struts on all WEb/Application SErver are supported java technologies.
 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In an existing application with lots of session beans and entity beans, replacing existing entity beans with Hibernate offers any improvement? if so what are they?
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to change from ejb to hibernate, you MUST got risk to development.
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Arun Prasath:
In an existing application with lots of session beans and entity beans, replacing existing entity beans with Hibernate offers any improvement? if so what are they?



Hibernate domain objects are POJO without any complicated life cycle methods that Entity beans have.
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate also supports Inheritance which is missing in entity beans.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB Inheritant
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by somkiat puisungnoen:
EJB Inheritant



I have read that before. Inheritance in Hibernate is much easier than what you could possibly do using entity beans
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, EJB inheritance is difficult more than hibernate.
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any particular reason why developers should consider using hibernate rather than Entity Beans. Entity Beans are tested component, provided by Sun.
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Prakash Dwivedi:
Is there any particular reason why developers should consider using hibernate rather than Entity Beans. Entity Beans are tested component, provided by Sun.



Hibernate is a light weight framework where the domain objects are POJO rather than implementing EntityBean interface with bunch of lifecycle method. there are more reasons, Checkout the Hibernate introduction pdf from www.hibernate.org.

EJB 3.0 is based on Hibernate idea. It makes entity bean class a POJO.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Entity Beans are tested component



No, Entity Bean is Business component that it's provides by SUN.

Entity Bean is used in world business application, But Entity bean /SEssion bean (EJB) are have overhead very much because EJB container provided several task such as Transaction, Security managemend , Life Cycle .. etc .
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate looks like its getting more and more popular, however, is it matured enough to replace something like EJBs altogether? Or can they be used together at any stage?

Also, is there an equivalent feature in Hibernate to compare against EJB roles and security?

Thanks,

Ashok.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate VS EJB 1

Hibernate VS EJB 2
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ashok Mash:
Hibernate looks like its getting more and more popular, however, is it matured enough to replace something like EJBs altogether? Or can they be used together at any stage?

Also, is there an equivalent feature in Hibernate to compare against EJB roles and security?

Thanks,

Ashok.



Hibernate is an alternative to entity beans and not EJB itself. Many applications use session beans with Hibernate.
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by somkiat puisungnoen:


No, Entity Bean is Business component that it's provides by SUN.

Entity Bean is used in world business application, But Entity bean /SEssion bean (EJB) are have overhead very much because EJB container provided several task such as Transaction, Security managemend , Life Cycle .. etc .



I think Prakash meant that Entity beans have been used in many applications so is a tested component. The reality is Hibernate is popular because of shortcoming in entity beans. EJB 3.0 should over come those.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Entity Bean is used in world business application, But Entity bean /SEssion bean (EJB) are have overhead very much because EJB container provided several task such as Transaction, Security managemend , Life Cycle .. etc .



Does Hibernate support Transactions and Security Management? Because these can be very important in an Enterprise Application.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does if you use it in a container, or in conjunction with seperate security and TransactionManager layers. Hibernate is just an ORM layer, which is one of its main benefits.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
If you don't want to use ejb container for data persistance...check out Sun JDO more stable and proven technology than Hibernate.
 
Author
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings. The JavaRanch book for the day is Better, Faster, Lighter Java. It's got a pretty good overview of Hibernate.

When you build applications, often you want to deal with your data as if it were stored in objects, instead of rows and columns like JDBC. This general strategy is called Transparent Persistence.

I like Hibernate because it's query language is closer to SQL than most other persistence frameworks. That makes it easier to learn, and also made it easier to build. JDO also has some excellent products, like Kodo JDO, and Versant's JDO implementation (used to be JDO Genie.)

The EJB2 model is pretty much supported for compatibility only from EJB3.0 forward. In fact, we're not quite sure what the persistence model will be, but it's likely to be closer to Hibernate or JDO (actually, the JDO expert group and the EJB expert group which has Gavin King, the Hibernate inventor), are working together to form the persistence standard for EJB.

I hope this helps.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does Hibernate support Transactions and Security Management?



Bibernate support both.

Transaction in hibernate, you can use JTA(Java TRansaction API).

Security in hibernate, you can use JASS.

REference Website
http://www.hibernate.org/139.html
http://www.hibernate.org/164.html
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

check out Sun JDO more stable and proven technology than Hibernate.



Couls you please explain how?
 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
=== courtesy sanjib ghosh from my company tavant ===

EJB3.0 early draft is out for review: http://java.sun.com/products/ejb/docs.html
Those who hate EJB must take a look at this. The fat is gone. It has become simple POJI/POJO model. Add a few annotations to it and you get an EJB. Seriously, no more Home interface, no more DD hell. No more JNDI reference in your code. Container services are provided using dependency injection ( to learn more read : http://www.martinfowler.com/articles/injection.html ) . Bye Bye Service Locator pattern. You can very easily test it outside the container. Don't you just love it. Wait, there is more ...


The whole entity bean model is changed completely. It is almost identical(even syntax wise) to Hibernate 2.x. Take a look at what future entity bean would look :
http://hibernate.org/~gavin/ebejb3.pdf Suddenly, DTO becomes an anti-pattern!

However, there are some issues with java persistence model in the community. There is some big ego fight going on between EJB EG and JDO EG for last couple of months. It creates even more confusion as Entity Bean 3.0 model is so much similar to JD0 2.0 model. Geir & Jeremy state the whole confusion nicely and suggested a solution: http://blogs.codehaus.org/people/geir/archives/000758_persisting_problems.html
Let's see if these two EG converge and come out with one solution for persistence. Either way, we get a TRANSPARENT persistence model.





In short, hibernate is just great
 
Kalpesh Soni
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
more

follow links on this page
https://coderanch.com/t/215003/ORM/java/Hibernate-JDO





KSEJB3.0 and JDO2.0
[ October 14, 2004: Message edited by: Kalpesh Soni ]
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic