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

Jose CHILLAN (JIRA) noreply at atlassian.com
Thu Feb 28 07:07:33 EST 2008


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

Jose CHILLAN commented on HHH-3129:
-----------------------------------

Ok, but it seems odd to me that the collection.setSnapshot() is invoked in the constructor with a loadedKey and role that have not
been populated before: it looks like a quick copy-paste, or if the intention was to pass null, I would rather put 'null' as parameters.

Is there a workaround or another way to know where a collection comes from in an Interceptor ?

> Null Role in PersitentCollection during a onCollectionRecreate() in an Interceptor
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-3129
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3129
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.6
>         Environment: Any
>            Reporter: Jose CHILLAN
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> 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.
-
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