[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4087) Session.flush() Causes AssertionFailure

Bernardo Orilio Bennett (JIRA) noreply at atlassian.com
Thu Aug 20 15:40:15 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33834#action_33834 ] 

Bernardo Orilio Bennett commented on HHH-4087:
----------------------------------------------

It seems related to the fact that Hibernate is issuing a select to retrieve the generated properties of the component before persisting the list. EntityMetamodel.hasInsertGeneratedValues() returns true in 3.2.4, but in 3.1.3 it returns false and because of that 3.1.3 does not perform the select and you must explicitly call refresh().
Maybe it could cascade first and then get the generated values after?

>  Session.flush() Causes AssertionFailure
> ----------------------------------------
>
>                 Key: HHH-4087
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4087
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.4.sp1
>            Reporter: Brian
>
> After calling Session.save() with an entity, calling Session.flush() causes the following error.
> org.hibernate.AssertionFailure: collection [com.example.myList] was not processed by flush()
>  at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)
>  at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:333)
>  at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
>  at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
> The mapping used was:
> <component name="component" class="Component"> 
>     <property name="sequence" column="SEQUENCE" not-null="false" generated="insert"/> 
>     <list name="myList" table="MY_LIST"> 
>         <key column="MY_LIST_KEY"/> 
>         <index column="INDEX_COL"/> 
>         <composite-element class="MyCompositeElement"> 
>             <property name="element" column="ELEMENT"/> 
>         </composite-element> 
>     </list> 
> </component>

-- 
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