[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6375) filter condition ignored by isEmpty() and size() on lazy PersistentBag

Ken Jarrad (JIRA) noreply at atlassian.com
Tue Jun 28 08:31:53 EDT 2011


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

Ken Jarrad commented on HHH-6375:
---------------------------------

I have a workaround for this problem that may be helpful to others. You must force the loading of the collection. I use method iterator() to achieve this (I don't use the iterator that is returned). Do this before you call size() or isEmpty() or binarySearch() or ....

> filter condition ignored by isEmpty() and size() on lazy PersistentBag 
> -----------------------------------------------------------------------
>
>                 Key: HHH-6375
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6375
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.1
>         Environment: Hibernate 3.5.1 with Derby dialect
>            Reporter: Ken Jarrad
>            Priority: Minor
>
> Filter conditions are ignored by methods isEmpty() and size() on a lazy PersistentBag.
> More specifically, internal method readSize() ignores enabled filter conditions.
> The size returned is too large and subsequent attempts to access the collection throw ArrayIndexOutOfBoundsException.
> Methods such as Collections#binarySearch fail when applied to the lazy PersistentBag.

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