Skip to content

LDAP-153: Spring Pooling does not support sorting ; Cannot call setRequestControls on a pooled context #188

@spring-projects-issues

Description

@spring-projects-issues

Thomas B(Migrated from LDAP-153) said:

When one use spring’s PoolingContextSource and Ldap sorting (through “SortControlDirContextProcessor”) or result limit (throuh “PagedResultsRequestControl”) this is causing a deadly UnsupportedOperationException(“Cannot call setRequestControls on a pooled context”).
Sun’s build in ‘supports’ this kind of controls (but see http://forum.springframework.org/showthread.php?p=213254 )

My guess joins Rasky’s explaination : Control state is kept on the server side wich means that sun’s impl is probably broken but at least request keep flowing.
Rasky’s idea of clearing the controls while returning connexion to the pool should be fine but how do we know the initial server state (if any : I don’t know the LDAProtocol very well)

Here is the stack trace
java.lang.UnsupportedOperationException: Cannot call setRequestControls on a pooled context
at org.springframework.ldap.pool.DelegatingLdapContex t.setRequestControls(DelegatingLdapContext.java:18 5)
at org.springframework.ldap.control.AbstractRequestCo ntrolDirContextProcessor.preProcess(AbstractReques tControlDirContextProcessor.java:83)
at org.springframework.ldap.core.support.AggregateDir ContextProcessor.preProcess(AggregateDirContextPro cessor.java:75)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:271)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:234)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions