[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2112) ClassCastException in StatefulPersistenceContext.getCachedDatabaseSnapshot(...)

Douglas A. Herrick (JIRA) noreply at atlassian.com
Tue Nov 21 16:07:04 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2112?page=comments#action_25386 ] 

Douglas A. Herrick commented on HHH-2112:
-----------------------------------------

I looked into this today:  for us, it was bit of a red herring; however, I thought other might be interested the root cause of our snafu... In our case, the object that triggered the hibernate exception during flush processing (for us, this occurred when hibernate executed a flush before resolving a query) had not assigned a reference to an object that would have satisified a foreign key constraint.  Actually, I'd argue that, in this context, that is, flushing before executing a query, hibernate should not barf the way it did, since execution of the query was not dependend upon the assignment of the foreign key.  While flush processing during commit might warrant this exception (since the foreign key constraint would have failed), preprocessing (i.e., flushing) for the query does not.

> ClassCastException in StatefulPersistenceContext.getCachedDatabaseSnapshot(...)
> -------------------------------------------------------------------------------
>
>          Key: HHH-2112
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2112
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.0.cr4
>     Reporter: Aleksei Valikov

>
>
> StatefulPersistenceContext.getCachedDatabaseSnapshot(EntityKey key) causes ClassCastException when NO_ROW was put for the certain entity key.
> Please see the discussion here:
> http://forum.hibernate.org/viewtopic.php?t=959868&highlight=getcacheddatabasesnapshot
> In these situations, this method should probably return null. It is very likely since other calling methods check for the returned value to be null .

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list