Re: OpenJPA vs EclipseLink

2012-05-03 Thread Mark Struberg
Hi Andrew!

When I did my first evaluations for a new project 3 years ago. Back then I was 
checking out the sources fo EclipseLink, Hibernate and OpenJPA.

EclipseLink just didn't cut it at all. From what I've heard, the Eclipse 
community now rewrote a huge part of the code already, but they are imo still 
quite a few miles away from being production ready. I have honestly no idea how 
it could have become the RI for JPA...

Hibernate is much better. It basically works pretty well and is also relatively 
fast. There is only one thing which I don't like that much and this is their 
subclassing approach for 'enhancement'. This has a few nasty side effects and 
you need to know them.

I finally picked OpenJPA because it was (in my tests) the only JPA provider 
which was able to reliably serialize/deserialize entities without loosing state 
or trashing the database afterwards. I really need this because we have a real 
cluster environment and peak 5 mio page hits/day in our app, so not being able 
to serialize is a knock out. Of course you need a few magic properties in your 
persistence.xml:

property name=openjpa.DetachState value=loaded(DetachedStateField=true)/
property name=openjpa.Compatibility 
value=IgnoreDetachedStateFieldForProxySerialization=true/

The problem with the other JPA providers was the following scenario: 

1.) load from db
2.) change
3.) serialize (store in JSF @ViewScoped and wait for 2nd request)
4.) deserialize 

5.) change in the JSF applyValues phase

6.) merge in a JSF action


if you could change 5 and 6 then the other providers work as well. Too bad that 
doesn't fit the JSF workflow!
OpenJPA accomplishes this by _still_ using a StateManager, even if the entity 
is detached. 


In EclipseLink this didn't work at all.

In Hibernate it will work if you do _not_ use any Lazy Loading. Maybe that's 
the reason why HIbernate in the default modeeven ignores FetchType.LAZY in the 
top layer of your entity and always does eager fetching.




LieGrue,
strub


PS: I'm using build-time-enhancement with the openjpa-maven-plugin



- Original Message -
 From: Andrew Hastie and...@ahastie.net
 To: users@openjpa.apache.org
 Cc: 
 Sent: Wednesday, May 2, 2012 8:56 PM
 Subject: Re: OpenJPA vs EclipseLink
 
 For information, OpenJPA it is also embedded with IBM WebSphere.
 
 On 02/05/12 19:25, José Luis Cetina wrote:
  Hi im newbie in OpenJPA i know OpenJPA is an implementation as EclipseLink,
  i always used EclipseLink, now im moving from Glassfish to TomEE and i see
  openjpa is embeded with TomEE, i read the OpenJPA manual and i like the
  innovations in openjpa, but i just want to know the
  advantages/disadvantages of openjpa, or a little comparative with openjpa
  vs eclipselink or hibernate, and one more thing about how fast is openjpa
  vs others.
 



Re: OpenJPA vs EclipseLink

2012-05-03 Thread afryer
One thing to be aware of is if you see performance comparisons on the
internet, make sure you know if the OpenJPA results are using openjpa
enhanced classes or not.  I've seen some very misleading stats comparing
OpenJPA to other ORMs using non-enhanced classes.

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-vs-EclipseLink-tp7521217p7525247.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: OpenJPA vs EclipseLink

2012-05-03 Thread Mark Struberg


or tests without any jdbc pool ;)

LieGrue,
strub




 From: afryer apfr...@hotmail.com
To: users@openjpa.apache.org 
Sent: Thursday, May 3, 2012 11:27 PM
Subject: Re: OpenJPA vs EclipseLink
 
One thing to be aware of is if you see performance comparisons on the
internet, make sure you know if the OpenJPA results are using openjpa
enhanced classes or not.  I've seen some very misleading stats comparing
OpenJPA to other ORMs using non-enhanced classes.

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-vs-EclipseLink-tp7521217p7525247.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.