directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Carlos Marin Rincon <jmari...@gmail.com>
Subject Re: LDAP API search cursor returns diferent number of values
Date Mon, 18 Apr 2016 15:24:11 GMT
Hi Emmanuel,

Actually I tried with version M33, but the result is the same, the reason
for M20 is the application is older and we can't upgrade libraries because
we can get collateral damage with other libraries (commons). I read your
answer for the mailing list but not for mail. I hope you can read this
message. Thanks a lot.

Juan Carlos Marín Rincón
Software Architect

2016-04-15 14:59 GMT-05:00 Juan Carlos Marin Rincon <jmarin83@gmail.com>:

>
> Hi all,
>
> I´m try to run a search into Tivoli Directory Server, the query is:
> (&(objectClass=gruopOfUniqueNames)(uniquemember=<entry_dn>)). If I run that
> query in Apache Directory Studio i get 43 entries, but when I try to run
> that query in a Java program, never get the 43 entries, sometimes get 40,
> sometimes 38, 35, 20, 25, 29... entries, but never the 43 entries. I'm
> using api-all-1.0.0-M20, I try with version M33 too, but I got the same
> result, sometimes i got entries, sometimes not, but never i got all
> results. This issue is urgent because affects PRODUCTION environment.
> Thanks for any help.
>
> My Code:
>
> EntryCursor cursor = null;
> LdapConnection conn = null;
> String query =
> "(&(objectClass=groupOfUniqueNames)(uniquemember=<user_dn>))";
> try {
>     LdapConnectionConfig config = new LdapConnectionConfig();
>     config.setLdapHost(<server_ip>);
>     config.setLdapPort(<port>);
>     config.setName(<user>);
>     config.setCredentials(<password>);
>
>     for (int i = 0; i < 10; i++) {
>         conn = new LdapNetworkConnection(config);
>         conn.bind();
>
>         cursor = conn.search("<base_path>", query, SearchScope.SUBTREE);
>
>         List<Entry> result = new ArrayList<Entry>();
>
>         while (cursor.next()) {
>             result.add(cursor.get());
>         }
>
>         System.out.println("ENTRIES IT " + i + " : " + result.size());
>
>         try {
>             if (cursor != null) {
>                 cursor.close();
>             }
>
>             if (conn != null) {
>                 conn.close();
>             }
>         } catch (IOException e) {
>             e.printStackTrace();
>         }
>     }
> } catch (LdapException e) {
>     e.printStackTrace();
> } catch (CursorException e) {
>     e.printStackTrace();
> }
>
>
> Results:
>
> ENTRIES IT 0 : 0
> ENTRIES IT 1 : 40
> ENTRIES IT 2 : 20
> ENTRIES IT 3 : 0
> ENTRIES IT 4 : 0
> ENTRIES IT 5 : 40
> ENTRIES IT 6 : 0
> ENTRIES IT 7 : 33
> ENTRIES IT 8 : 0
> ENTRIES IT 9 : 26
>
> Juan Carlos Marín Rincón
> Software Architect
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message