[ 
https://issues.apache.org/jira/browse/FC-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17567474#comment-17567474
 ] 

Shawn McKinney commented on FC-313:
-----------------------------------

Use pattern per described in LDAP API guide: 
https://directory.apache.org/api/user-guide/2.3-searching.html


Sample code;

```
            try ( SearchCursor searchResults = search( ld, groupRoot, 
SearchScope.ONELEVEL, filter, GROUP_ATRS, false,
                
Config.getInstance().getInt(GlobalIds.CONFIG_LDAP_MAX_BATCH_SIZE, 
GlobalIds.BATCH_SIZE ) ) )
            {
                long sequence = 0;
                while ( searchResults.next() )
                {
                    groupList.add( unloadLdapEntry( searchResults.getEntry(), 
sequence++ ) );
                }
            }
            catch ( IOException i )
            {
                String error = "find filter [" + filter + "] caught 
IOException=" + i.getMessage();
                throw new FinderException( GlobalErrIds.GROUP_SEARCH_FAILED, 
error, i );
            }
            catch ( CursorException e )
            {
                String error = "find filter [" + filter + "] caught 
CursorException=" + e.getMessage();
                throw new FinderException( GlobalErrIds.GROUP_SEARCH_FAILED, 
error, e );
            }
```

> not closing search cursor
> -------------------------
>
>                 Key: FC-313
>                 URL: https://issues.apache.org/jira/browse/FC-313
>             Project: FORTRESS
>          Issue Type: Improvement
>    Affects Versions: 2.0.7
>            Reporter: Shawn McKinney
>            Assignee: Shawn McKinney
>            Priority: Major
>             Fix For: 2.0.8
>
>
> The Fortress DAO modulues are not properly closing the search cursor.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org

Reply via email to