<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
#email-body { min-width: 30em !important; }
#email-page { padding: 8px !important; }
#email-banner { padding: 8px 8px 0 8px !important; }
#email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
#email-fields { padding: 0 8px 8px 8px !important; }
#email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
<tr valign="top">
<td id="email-page" style="padding:16px !important;">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
<tr valign="top">
<td bgcolor="#3e4c4e" style="background-color:#3e4c4e;color:#ffffff;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="https://www.jboss.org/dms/hibernate/images/jira/jiraheader_hibernate.png" alt="" style="vertical-align:top;" /></td>
</tr><tr valign="top">
<td id="email-banner" style="padding:32px 32px 0 32px;">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
<img id="email-avatar" src="https://hibernate.onjira.com/secure/useravatar?ownerId=brmeyer&avatarId=11140" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
<div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
<a class="user-hover" rel="brmeyer" id="email_brmeyer" href="https://hibernate.onjira.com/secure/ViewProfile.jspa?name=brmeyer" style="color:#6c797f;">Brett Meyer</a>
updated <img src="https://hibernate.onjira.com/images/icons/bug.gif" height="16" width="16" border="0" align="absmiddle" alt="Bug"> <a style='color:#6c797f;text-decoration:none;' href='https://hibernate.onjira.com/browse/HHH-7821'>HHH-7821</a>
</div>
<div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
<a style='color:#6c797f;text-decoration:none;' href='https://hibernate.onjira.com/browse/HHH-7821'><strong>NPE after upgrade from 4.1.6 to 4.1.8</strong></a>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td id="email-fields" style="padding:0 32px 32px 32px;">
<table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
<tr valign="top">
<td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Change By:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="brmeyer" id="email_brmeyer" href="https://hibernate.onjira.com/secure/ViewProfile.jspa?name=brmeyer" style="color:#6c797f;">Brett Meyer</a>
(01/Feb/13 12:04 PM)
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Description:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<span class="diffcontext">From my post on the mailing list:<br><br>Hi,<br><br>After upgrading from *4.1.6* to *4.1.8*, we have a couple of regressions<br>in one of our applications.<br><br>We tried to obtain self contained test cases and understand what the<br>problem is but it's quite hard to reproduce and we haven't found a way<br>to isolate the problem yet.<br><br>Anyway, I was wondering if the stacktraces could ring a bell for<br>someone to help us analyze the problem. It might even be an obvious<br>bug for you once you have the stracktrace.<br><br></span>
<span class="diffremovedchars" style="background-color:#ffe7e7;text-decoration:line-through;">Here are both stacktraces for the regressions we have:<br><br></span>
<span class="diffcontext">Stacktrace 1 (only when we configure the batch loading - might be due<br>to a race condition because it's not systematic):<br><br></span>
<span class="diffaddedchars" style="background-color:#ddfade;">{code}<br></span>
<span class="diffcontext">Caused by: java.lang.NullPointerException<br> at<br>org.hibernate.type.descriptor.java.AbstractTypeDescriptor.extractHashCode(AbstractTypeDescriptor.java:88)<br> at<br>org.hibernate.type.AbstractStandardBasicType.getHashCode(AbstractStandardBasicType.java:210)<br> at<br>org.hibernate.type.AbstractStandardBasicType.getHashCode(AbstractStandardBasicType.java:214)<br> at org.hibernate.cache.spi.CacheKey.calculateHashCode(CacheKey.java:71)<br> at org.hibernate.cache.spi.CacheKey.<init>(CacheKey.java:67)<br> at<br>org.hibernate.internal.AbstractSessionImpl.generateCacheKey(AbstractSessionImpl.java:252)<br> at<br>org.hibernate.engine.spi.BatchFetchQueue.isCached(BatchFetchQueue.java:330)<br> at<br>org.hibernate.engine.spi.BatchFetchQueue.getCollectionBatch(BatchFetchQueue.java:312)<br> at<br>org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:72)<br> at<br>org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:678)<br> at<br>org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:80)<br> at<br>org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1804)<br> at<br>org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549)<br> at<br>org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234)<br> at<br>org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)<br> at<br>org.hibernate.collection.internal.PersistentBag.removeAll(PersistentBag.java:345)<br></span>
<span class="diffaddedchars" style="background-color:#ddfade;">{code}</span>
<span class="diffcontext"><br><br></span>
<span class="diffremovedchars" style="background-color:#ffe7e7;text-decoration:line-through;"><br><br><br>Stacktrace 2 (we have this one even if we disable the batch loading):<br><br>Caused by: java.lang.NullPointerException<br> at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:259)<br> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)<br> at<br>org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:160)<br> at<br>org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:151)<br> at<br>org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)<br> at<br>org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)<br> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)<br> at<br>org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:986)<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br> at<br>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br> at<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br> at java.lang.reflect.Method.invoke(Method.java:597)<br> at<br>org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)<br> at $Proxy115.flush(Unknown Source)<br><br><br></span>
<span class="diffcontext">Followup of this post:<br>The errors are quite hard to reproduce and we only have them in a *big* application with a lot of entities when we are bulk loading a lot of objects. We don't reproduce these problems on the smaller ones. That's why a self contained test case is hard to get.<br><br>They are totally reproducable on this application though.<br><br></span>
<span class="diffremovedchars" style="background-color:#ffe7e7;text-decoration:line-through;">From what we saw in the code, at least one of the stacktraces comes from a place modified in 4.1.8. That's why we hoped it could ring a bell just to have the stacktraces.<br><br>Typically this one:<br>Caused by: java.lang.NullPointerException<br> at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:259)<br> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)<br> at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:160)<br> at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:151)<br> at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)<br> at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)<br> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)<br> at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:986) <br><br>seems to be related to this particular commit:<br>https://github.com/hibernate/hibernate-orm/commit/deaff9705e564b33b92b3eac9fdee89815ce1a44<br><br></span>
<span class="diffcontext">Should we try to reproduce it in a debug environment with a conditional breakpoint to see if we can have more information about the context?<br><br></span>
<span class="diffremovedchars" style="background-color:#ffe7e7;text-decoration:line-through;">For the other one, I don't have any idea yet.<br><br></span>
<span class="diffcontext">In this commit, I find a little weird that the hashCode is tested before testing the type but I don't think it might be related to the problem at hand.<br>https://github.com/hibernate/hibernate-orm/commit/fae0d3f49877a5a11a7ac5cef25bb91235906fab</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td><!-- End #email-page -->
</tr>
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
This message is automatically generated by JIRA.<br />
If you think it was sent incorrectly, please contact your JIRA administrators<br />
For more information on JIRA, see: <a style='color:#6c797f;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
</td>
</tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->