users@glassfish.java.net

Re: Why is TopLink the default provider in GlassFish and not Hibernate?

From: <glassfish_at_javadesktop.org>
Date: Sun, 29 Jul 2007 10:21:10 PDT

I've been using hibernate in glassfish since I figured out that toplink won't support the sequences that are in place. I recently gave it a try again and found that it still didn't work with the sequences:

@SequenceGenerator(sequenceName="oid_sequence", name="oidSequence")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="oidSequence")

This seems to work fine in Hibernate, but doesn't do anything with just toplink.

Another interesting aspect of the differences is that when using hibernate I can use the left join fetch queries extensively (left join fetch o.subobject1 so1 left join fetch so1.subobject2 so2 left join fetch so2.subobject3 (etc.)). As far as I can tell this goes against the Java EE Spec and is thus not allowed in Toplink (which makes your code unportable). However I found it very convenient. On the other side of it though, I think it is less performant to do it this way than to let toplink cache the objects and populate them separately. It seems that running the same cache loading scheme was faster in toplink than with hibernate.

I will post more when I can get caught up and analyze the differences a little better.

-Geoff
[Message sent by forum member 'gcruscoe' (gcruscoe)]

http://forums.java.net/jive/thread.jspa?messageID=228675