[hibernate-issues] [Hibernate-JIRA] Commented: (HV-356) Consider if issue when bean's hashCode() uses lazy-loaded property needs to be addressed in default event listener/validator implementation

Roman Arkadijovych Muntyanu (JIRA) noreply at atlassian.com
Fri Dec 17 09:56:13 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39386#action_39386 ] 

Roman Arkadijovych Muntyanu commented on HV-356:
------------------------------------------------

Our case is: we use hashCode() for placing objects in hash staructures (e.g. hash sets) and some times, to uniquely identify the object you need to know its parent. E.g. many-to-many mapping table with additional fields for which one of the parent tables is lazily-loaded but both are required for hashCode calculation. For our case all of the hashCode() usages are within spring-managed hibernate sessions that result in ability to lazily load the object upon hashCode() call. While for validation stage this fails.


> Consider if issue when bean's hashCode() uses lazy-loaded property needs to be addressed in default event listener/validator implementation
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HV-356
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-356
>             Project: Hibernate Validator
>          Issue Type: Task
>          Components: validators
>    Affects Versions: 4.1.0.Final
>         Environment: Hibernate 3.5.3-Final, Spring 3.0.3.RELEASE, Hibernate Validator 4.1.0.Final
>            Reporter: Roman Arkadijovych Muntyanu
>            Priority: Minor
>             Fix For: 4.x
>
>   Original Estimate: 16h
>  Remaining Estimate: 16h
>
> This issue has been created based on contributor's request in discussion 
>    https://forum.hibernate.org/viewtopic.php?f=9&t=1006194&start=0
> related to the issue occurring when persisted object's hashCode() implementation uses lazily-loaded properties. 
> This triggers "collection [...] was not processed by flush()" issue with default Hibernate Validator event listener (org.hibernate.cfg.beanvalidation.BeanValidationEventListener) and validator (org.hibernate.validator.engine.ValidatorImpl) implementations because of hashCode() usage in SingleThreadCachedTraversableResolver.buildHashCode().
> The purpose of this task is to consider whether this is or is not an overlook in assumptions made in validator implementation. And depending on the result following outcomes are expected:
>  * either create a separate task for addressing the issue in default validator implementation;
>  * or provide suggestions and (if possible) examples on how the issue can be addressed at the framework user's site if lazily-loaded properties usage IS appropriate.

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