[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3129) Null Role in PersitentCollection during a onCollectionRecreate() in an Interceptor

Kamil J (JIRA) noreply at atlassian.com
Fri Aug 19 16:06:07 EDT 2011


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

Kamil J commented on HHH-3129:
------------------------------

Is there any workaround for this bug?

> Null Role in PersitentCollection during a onCollectionRecreate() in an Interceptor
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-3129
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3129
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.6
>         Environment: Any
>            Reporter: Jose CHILLAN
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When the "onCollectionRecreate" is invoked on an Interceptor, the getRole() method returns null. After investigation, 
> the problem is located in the class CollectionEntry in one of its constructors and is easily solved using the patch :
> public CollectionEntry(CollectionPersister persister, PersistentCollection collection) 
> {
>   // new collections that get found + wrapped
>   // during flush shouldn't be ignored
>   ignore = false;
>   collection.clearDirty(); //a newly wrapped collection is NOT dirty (or we get unnecessary version updates)
>   snapshot = persister.isMutable() ?  collection.getSnapshot(persister) : null;
>   // -- ADDED LINE HERE --
>   role = persister.getRole();
>   collection.setSnapshot(loadedKey, role, snapshot);
> }
> Thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list