Comments (4)
Mark Paluch commented
See https://github.com/spring-projects/spring-data-ldap/tree/issue/DATALDAP-30
from spring-data-ldap.
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.
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.
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)
- Upgrade to Maven Wrapper 3.9.5
- Upgrade to Maven Wrapper 3.9.5
- Upgrade to Maven Wrapper 3.9.5
- Upgrade to Maven Wrapper 3.9.5
- Upgrade to Spring LDAP 3.0.6
- Upgrade to Spring LDAP 3.1.2 HOT 1
- Upgrade to Spring LDAP 3.2.0-RC1
- Upgrade to Spring LDAP `3.1.2`
- Release 3.0.12 (2022.0.12)
- Release 3.1.6 (2023.0.6)
- Release 3.2 GA (2023.1.0)
- Release 2.7.18 (2021.2.18)
- findAll function in LdapRepository does not respect @Entry's base dn HOT 1
- Upgrade to Spring LDAP 3.2.0
- How to add and objectClass dynamically HOT 4
- Release 3.1.7 (2023.0.7)
- Release 3.2.1 (2023.1.1)
- Release 3.3 M1 (2024.0.0)
- Add support for parametrized `@Query` HOT 3
- Introduce property for Jenkins user and Artifactory server details
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-ldap.