[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: JLDAP: No results on multiple synchronous searches



Brandon Hume - OpenLDAP list wrote:
http://developer.novell.com/documentation/jldap/jldapenu/api/com/novell/ldap/LDAPSearchResults.html#getCount()

note that the getCount method "reports the number of results received so far". It's a synchronouos search

I did see that. I did understand it. However, I also do not see any methods via LDAPSearchResults to indicate when the response has been received.

Have you considered an asynchronous search? The returned LDAPSearchQueue does have an isComplete() method, so you can be sure.


Better yet, try setting the batchsize constraint on your search to 0. Default will block an entry at a time.

As I said in my post, if I use next(), I get an exception. I don't get an
exception along the lines of "EAGAIN", I get 82, LOCAL ERROR.

I can't duplicate this against OpenLDAP, and I do this sort of thing all the time. I've also never seen an 82 code from OpenLDAP, so maybe you should specify directory, OS, version, etc.


I should also point out, that in this situation, hasMore () returns *true*.

Try checking hasMore() before calling next() to avoid errors.

if ( r.hasMore() ) System.err.println ( r.next() );

Expecting the software to behave how it does not.

When you perform a synchronous search with a batchsize of 1 you will usally want to do something with the results before attempting to count them all.


(Please reply to the list, not to All. I don't need two copies.)
>
> Yay, patronizing.

Hey, sorry. Need more help?

Jon Roberts
www.mentata.com