Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the best pairing with JPA?

 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day,

There is a new project and we are about to figure out what is the popular technology we should apply in persistence layer?

a bit shame as worked on JDBC thus far, and do not have much commercial experience on ORM, and I know there are common pair on JPA either with Hibernate or EJB3.

my questions are,

1. what is the best choice for ORM implementation by considering shorter learning curve, and high popularity if our system use spring MVC as backbone?

2. What is the pro and cons for JPA pairing with hibernate and EJB3?

3. Book or reference for JPA?
 
James Sutherland
Ranch Hand
Posts: 553
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The three main JPA implementations are Hibernate, EclipseLink and OpenJPA.

Each application server defaults to one of the implementations:
Glassfish - EclipseLink
WebLogic - EclipseLink
WebSphere - OpenJPA
JBoss - Hibernate

For more info on JPA, see http://en.wikibooks.org/wiki/Java_Persistence
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Best" in what respect? I've successfully used OpenJPA.
 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:"Best" in what respect? I've successfully used OpenJPA.


Best in the sense of better performance and most robust. and if possible, shorter learning curve
 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Sutherland wrote:The three main JPA implementations are Hibernate, EclipseLink and OpenJPA.

Each application server defaults to one of the implementations:
Glassfish - EclipseLink
WebLogic - EclipseLink
WebSphere - OpenJPA
JBoss - Hibernate

For more info on JPA, see http://en.wikibooks.org/wiki/Java_Persistence


Thanks, that's a good reference site
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nakataa Kokuyo wrote:Best in the sense of better performance and most robust. and if possible, shorter learning curve

Performance probably depends a lot on your DB, so it's not easy for someone else to make a meaningful recommendation. It's also something you can easily test.

Learning curve is not a factor, as you'd be using the JPA API which is identical no matter which implementation you use.
 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
Nakataa Kokuyo wrote:Best in the sense of better performance and most robust. and if possible, shorter learning curve

Performance probably depends a lot on your DB, so it's not easy for someone else to make a meaningful recommendation. It's also something you can easily test.

Learning curve is not a factor, as you'd be using the JPA API which is identical no matter which implementation you use.


Thanks Ulf, what about popularity? pro and cons to pair with Hibernate and EJB.

I'm reading on Pro JPA2, it is more toward to EJB, and be honest, i see myself confuse on EJB3, just a Entity manager, persistence context and transactional have caused me confuse

Between, if pairing JPA with hibernate, do we need to understand the same concept or would the implementation be more directly? i can't seem find a book to mentioned just JPA and hibernate, probably guru here can point me out
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're confusing several different concepts. You're using either the EJB API or the JPA API, not both. Unless you're already using a JEE server, or have other reasons to use EJBs, I'd choose JPA instead - it can be deployed in a servlet container (EJBs can't).

JPA is an API for which several implementations are available: EclipseLink, Hibernate, OpenJPA, etc. You still have to choose one of those implementations after you've decided to use JPA itself.
 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I think you're confusing several different concepts. You're using either the EJB API or the JPA API, not both. Unless you're already using a JEE server, or have other reasons to use EJBs, I'd choose JPA instead - it can be deployed in a servlet container (EJBs can't).

JPA is an API for which several implementations are available: EclipseLink, Hibernate, OpenJPA, etc. You still have to choose one of those implementations after you've decided to use JPA itself.


Hi Ulf,

I think i would further study to JPA and Hibernate implementation, what is the recommended reference for these? appreciated your guidance !

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic