Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging LDAP query [DATALDAP-30] #51

Closed
spring-projects-issues opened this issue Apr 5, 2017 · 4 comments
Closed

Paging LDAP query [DATALDAP-30] #51

spring-projects-issues opened this issue Apr 5, 2017 · 4 comments
Assignees
Labels
in: repository Repositories abstraction status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Houcheng opened DATALDAP-30 and commented

We required a paging repository to query the LDAP database in paged


Issue Links:

  • DATALDAP-138 Handle large find all requests
    ("is duplicated by")

Referenced from: pull request #3

@spring-projects-issues
Copy link
Author

@spring-projects-issues
Copy link
Author

Mark Paluch commented

LDAP paging relies on a continuation cookie that is returned from the previous LDAP query. This cookie is only valid for the same connection. LdapTemplate always closes the connection except for transactional use. When using transactions ContextSourceTransactionManager sticks to the same connection so effectively LDAP paging on repository level would only work with transactions enabled and the user is required to provide an outer transaction.

Requiring transactions for paging isn't something you'd expect from repositories. I'm inclined to not implement paging and rather investigate whether we can provide streaming support for LDAP.

See also: http://docs.spring.io/spring-ldap/docs/2.0.2.RELEASE/reference/#paged-search-results

Houcheng what was your motivation to use LDAP paging?

@spring-projects-issues
Copy link
Author

Houcheng commented

Got it. The pagination request must be created in the context of a transaction, then the LDAP template will keep the connection until all paged retrieved. This seems the limitation of LdapTemplate and maybe could be enhanced, as most of the server's page cookie is not bound to the connection.

I have a software that uses LDAP query to understand the OU and permission of the company. Some company may have a very flat organization and one query may get hundred of results. Query without pagination will have a long response time and I worry that it would cause the timeout in Production.

@spring-projects-issues
Copy link
Author

Mark Paluch commented

Thanks for your fast response. I'm not convinced adding paging support to LdapRepository is a good idea right now. The conditions that are required to make LDAP paging work are restrictive in terms of transactions or depend a lot on the LDAP server details. It's not obvious from an API perspective that paging comes with this kind of limitations. I will close this ticket with "Won't fix" for now.

Using LdapTemplate with PagedResultsDirContextProcessor allows paging for now. Once we either figure out a way how to make paging work without imposing too many constraints, we might come back to this ticket

@spring-projects-issues spring-projects-issues added status: declined A suggestion or change that we don't feel we should currently apply in: repository Repositories abstraction type: enhancement A general enhancement labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository Repositories abstraction status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants