• 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

To Authors Mike, Merrick: EJB 3.0 advantages over Hibernate

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike Keith and Merrick Schincariol:-

How would you justify usage of EJB 3.0 over hibernate keeping in mind following concerns
1)Supporting multiple databases
2)Lightweight O/R mapping framework (Hibernate)
3)No EJB container is required for Hibernate, which can run on any servlet container. EJB can't be deployed on servlet container.
 
author
Posts: 304
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1)Supporting multiple databases


JPA is also database agnostic but the mappings are standardized, not proprietary.

2)Lightweight O/R mapping framework (Hibernate)


JPA is more lightweight than Hibernate or any other vendor impl.

3)No EJB container is required for Hibernate, which can run on any servlet container. EJB can't be deployed on servlet container.


JPA can be deployed in a servlet container, an EJB container, and outside any Java EE container at all (i.e. it can run just sitting in a Java SE runtime). When it does run inside a Java EE Container, though, the level of integration that you get with the Container surpasses what Hibernate or any other ORM framework can offer, and does so in a completely portable manner.

Remember, JPA is a specification, or API, not an implementation. Programming to a spec is always going to give you more portability. The weight of the implementation depends upon the provider that you use underneath.

-Mike
 
Vicky Pandya
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Keith:

JPA can be deployed in a servlet container, an EJB container, and outside any Java EE container at all (i.e. it can run just sitting in a Java SE runtime). When it does run inside a Java EE Container, though, the level of integration that you get with the Container surpasses what Hibernate or any other ORM framework can offer, and does so in a completely portable manner.

Remember, JPA is a specification, or API, not an implementation. Programming to a spec is always going to give you more portability. The weight of the implementation depends upon the provider that you use underneath.

-Mike



Thanks for the response Mike. Agreed on what you mentioned above. Though JPA is portable and can be deployed outside EE container, deployment of EJB 3.0 would still require EJB container.
 
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

JPA is more lightweight than Hibernate or any other vendor impl.



How is JPA more light weight than Hibernate ? Thanks.
 
author
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe Mike is referring to the size of the API, not the size of the implementation. The EntityManager and Query interfaces are relatively concise, yet still allow for a significant amount of power and flexibility.

Cheers,

Merrick
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Keith:

When JPA does run inside a Java EE Container, though, the level of integration that you get with the Container surpasses what Hibernate or any other ORM framework can offer, and does so in a completely portable manner.
-Mike



is it possible to use JPA without entity bean at all?

thanks,
anthony
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is it possible to use JPA without entity bean at all?


Yes, JPA can be used with anything. It can be used with J2SE too.
 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Satou kurinosuke:

Yes, JPA can be used with anything. It can be used with J2SE too.



I meant if we use JPA in EJB 3 container/enviroment, should we use Entity Bean (any advantage) or not?

btw, will Hibernate and others follow this JPA specification?

thanks again
anthony
 
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

btw, will Hibernate and others follow this JPA specification?


Yes
 
Mike Keith
author
Posts: 304
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Anthony Karta:
I meant if we use JPA in EJB 3 container/enviroment, should we use Entity Bean (any advantage) or not?

No, the entity bean model that includes entity-bean demarcated transactions and security is not recommended. It is more heavyweight than what is usually appropriate. People should use session beans for transaction demarcation and use the new JPA entity API for persistence.

-Mike
 
reply
    Bookmark Topic Watch Topic
  • New Topic