[infinispan-issues] [JBoss JIRA] (ISPN-2879) Have ResultIterator implement AutoCloseable

Sanne Grinovero (JIRA) jira-events at lists.jboss.org
Mon Mar 4 14:06:56 EST 2013


    [ https://issues.jboss.org/browse/ISPN-2879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758273#comment-12758273 ] 

Sanne Grinovero commented on ISPN-2879:
---------------------------------------

it's not the CacheQuery which needs to be closed but the ResultIterator. So it's still nice to do but doesn't solve the implicit iteration problem.

                
> Have ResultIterator implement AutoCloseable 
> --------------------------------------------
>
>                 Key: ISPN-2879
>                 URL: https://issues.jboss.org/browse/ISPN-2879
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Querying
>            Reporter: Sanne Grinovero
>            Assignee: Sanne Grinovero
>            Priority: Minor
>             Fix For: 6.0.0.Beta1
>
>
> Assuming we'll baseline on Java7, it would be very nice to have the following code valid and changing the default Fetch to LAZY:
> {code}
> Query query = queryBuilder.all().createQuery();
> CacheQuery cacheQuery = searchManager.getQuery(query, Bean.class);
> for (Object object : cacheQuery) {
>   ...
> }{code}
> the problem is the implicit iterable opened needs to be closed.
> see also ISPN-2874.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list