Skip to main content
Participant
October 12, 2007
Question

Cfldap limited results

  • October 12, 2007
  • 3 replies
  • 1509 views
I have a Sun Java Directory Server 5.2 with about 260,000+ entries in it. I cannot get coldfusion to return the full result set using code as shown below. I've cranked up every value on the ldap server and cf server that I can think of. It is not timing out. If I begin at row 0, I get about 17,000 back. If I set the start row at 20,000, I get 0 results.

Something is preventing me from 'counting' past 17,000. The time it takes to return 17,000 is very quick, like 3-4 seconds. If I set the start row at 20,000, it again takes 3-4 seconds for my query below to report zero.

Any ideas?

In the Sun configuration console, I've set the size, look through limit, time limit, and idle timeout to unlimited, and maxed out the request max size and response message max size (1755647 kb).

On the coldfusion server, under settings, I increased all the values, but that did not seem to change anything.

<cfset x=0>
<cfldap action="QUERY"
name="getuid"
attributes="uid"
start="ou=People,o=pcc.edu,o=cp"
startrow="0"
filter="uid=*"
server="*******"
port="*****"
timeout="9999"
username="********"
password="********">

<cfloop query="getuid">
<cfset x=x+1>
</cfloop>
<cfoutput>#x#</cfoutput>
    This topic has been closed for replies.

    3 replies

    Participating Frequently
    October 14, 2007
    First, there is no CF setting, in the CF administator, that pertains to CFLDAP.

    Second, try running the LDAP query "without" the TIMEOUT attribute.

    Next, I can't imagine that you would ever need to work with 260,000+ records in one query. You can, and probably should, break the queries into smaller segments.

    I'm not familiar with the Sun JDS, but why are you querying for a UID with a wildcard? Can you have directory entries without a UID? If so, then how many records "should have" a UID value?

    You may be better of using a different filter such as:

    FILTER="sn=a*"

    This will give you any last names (sn) that begin with "a".
    October 12, 2007
    As I understand it the startrow attribute only filters the results after they are returned from the LDAP query.

    Instead of startrow='20000' you might try filter="uid>=20000"
    jwhiteneAuthor
    Participant
    October 12, 2007
    Unfortunately, our uid values are not sequential. Its a 16 digit random number. So a filter of uid>=somevalue would not return useful results.
    jwhiteneAuthor
    Participant
    October 12, 2007
    Well, I'm guessing its on the ldap server side of things now. I googled around and found a jdlap java method by novell, installed that, and tried it like

    <cfset ldapConn = createObject("java", "com.novell.ldap.LDAPConnection").init()/>
    <cfset ldapConn.connect( "myserver", "myport" )/>

    <cfset userPwObj = createobject("java", "java.lang.String").init("mypassword")/>
    <!--- We need to place the password in an instance of java.lang.String because it needs to be passed to the LDAP as a byte array rather than a string. --->
    <cfset ldapConn.bind(3, "myadmindn", userPwObj.getBytes("UTF8"))/>

    <cfset attributeArray = createobject("java", "java.lang.String").init("uid,pdsLoginId").split(",")/>

    <cfset resultObj = ldapConn.search("ou=People,o=pcc.edu,o=cp",
    ldapConn.SCOPE_SUB,
    "uid=*",
    attributeArray,
    false)/>

    <cfset x=0>
    <cfloop condition="#resultObj.hasMore()#">
    <cfset ldapEntry = resultObj.next()/>
    <cfset uids = ldapEntry.getAttribute("uid") >
    <cfset x=x+1>

    </cfloop>
    <cfoutput>#x#</cfoutput>


    and despite my query limit being set like this in ldap nsslapd-sizelimit: 9999999, I get the error back,
    15:03:26.026 - com.novell.ldap.LDAPException - in D:\Inetpub\wwwroot\jason\replace.cfm : line 18

    Sizelimit Exceeded

    So, I'll post on Sun's site and see what ldap server setting I'm missing.
    Inspiring
    October 12, 2007
    This may be of limited help, because I have no recall of actual links,
    but some months (years?) back I remember reading a blog or two about
    size limitations using cfldap like what you described and some possible
    workarounds for the issue. With some good Google mojo maybe you can
    rediscover them.