[hibernate-issues] [JIRA] (HHH-11532) Loading extended entity by natural ID of base entity that exists in second level cache throws WrongClassException

Steve Ebersole steve at hibernate.org
Sun Dec 17 10:21:14 EST 2017


Interesting you don't complain about the same happening from loading by
id.  As I said above, I think this is the correct behavior.  Imo you are
looking at it from your specific perspective, which is fine, but here you
are asking Hibernate to load something as a particular type which (when it
is cached) Hibernate knows it is not.  That is the definition of an
exception to me.

On Sun, Dec 17, 2017, 5:55 AM Samuel Andersson (JIRA) <
jira at hibernate.atlassian.net> wrote:

> Samuel Andersson
> <https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=SamuelA>
> *commented* on [image: Bug] HHH-11532
> <https://hibernate.atlassian.net/browse/HHH-11532>
>
> Re: Loading extended entity by natural ID of base entity that exists in
> second level cache throws WrongClassException
> <https://hibernate.atlassian.net/browse/HHH-11532>
>
> Are you saying that throwing an exception (sometimes) when cache is
> enabled and returning null when it's disabled is correct? Should I, as a
> user of hibernate, have to catch this exception + check for null when I
> call this method? I don't really care whether an exception is thrown or
> not, but in my opinion behavior should be consistent regardless of 2nd
> level cache being enabled or not.
> [image: Add Comment]
> <https://hibernate.atlassian.net/browse/HHH-11532#add-comment> Add Comment
> <https://hibernate.atlassian.net/browse/HHH-11532#add-comment>
>
> Get Jira notifications on your phone! Download the Jira Cloud app for
> Android
> <https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail>
> or iOS
> <https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8>
> ------------------------------
> This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100075-
> sha1:240e3d8)
> [image: Atlassian logo]
> _______________________________________________
> hibernate-issues mailing list
> hibernate-issues at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-issues
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20171217/9123ff25/attachment.html 


More information about the hibernate-issues mailing list