[hibernate-dev] Question regarding the JPA 1.0 decision of making ToOne associations as EAGER

Emmanuel Bernard emmanuel at hibernate.org
Mon Feb 29 08:24:37 EST 2016


Well, it was more something like: the co-spec lead rules over the majority :)

Historically, very few implementations used proxies like Hibernate and
bytecode enhancement had (still has) its quirks.
A pretty bad and impactful decision unfortunately.

On Sun 2016-02-28 18:05, Steve Ebersole wrote:
> But to me that is not a reason EAGER is the default.  As the passage says,
> LAZY is just a hint.  So for a provider that does not support LAZY, EAGER
> would be used instead anyway.  No, some of the EG members specifically
> argued for wanting to-one associations to be EAGER by default.  IMO it was
> a bad decision.  But the majority rule.
> 
> On Sun, Feb 28, 2016 at 11:40 AM Vlad Mihalcea <mihalcea.vlad at gmail.com>
> wrote:
> 
> > Thanks,
> >
> > Rhe only reason I found is this paragraph:
> >
> > "The EAGER default for OneToOne and ManyToOne is for implementation
> > reasons (more difficult to implement), not because it is a good idea.
> > Technically in JPA LAZY is just a hint, and a JPA provider is not
> > required to support it, however in reality all main JPA providers support
> > it, and they would be pretty useless if they did not."
> >
> > https://en.wikibooks.org/wiki/Java_Persistence/Relationships#Lazy_Fetching
> >
> > Vlad
> >
> > On Sun, Feb 28, 2016 at 7:08 PM, Steve Ebersole <steve at hibernate.org>
> > wrote:
> >
> >> The Hibernate team argued against this, but we were outvoted.  So...
> >> sorry I cannot "justify it" ;)
> >>
> >> Obviously as our previous default shows we believe the associations
> >> should be lazy by default.
> >>
> >>
> >> On Sun, Feb 28, 2016 at 11:00 AM Vlad Mihalcea <mihalcea.vlad at gmail.com>
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>>
> >>> Do you remember why the JPA User Group decided to make the ManyToOne and
> >>> the OneToOne associations EAGER by default?
> >>>
> >>> In Hibernate 3.x, these associations used to be LAZY, so there must have
> >>> been a reason for taking this decision.
> >>>
> >>>
> >>> Thanks,
> >>>
> >>> Vlad
> >>> _______________________________________________
> >>> hibernate-dev mailing list
> >>> hibernate-dev at lists.jboss.org
> >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >>>
> >>
> >
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list