Git Product home page Git Product logo

Comments (4)

spring-projects-issues avatar spring-projects-issues commented on May 1, 2024

Mark Paluch commented

See https://github.com/spring-projects/spring-data-ldap/tree/issue/DATALDAP-30

from spring-data-ldap.

spring-projects-issues avatar spring-projects-issues commented on May 1, 2024

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?

from spring-data-ldap.

spring-projects-issues avatar spring-projects-issues commented on May 1, 2024

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.

from spring-data-ldap.

spring-projects-issues avatar spring-projects-issues commented on May 1, 2024

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

from spring-data-ldap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.