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

LDAP-319: add pagination support to LdapRepository #354

Open
spring-projects-issues opened this issue Feb 16, 2015 · 6 comments
Open

LDAP-319: add pagination support to LdapRepository #354

spring-projects-issues opened this issue Feb 16, 2015 · 6 comments

Comments

@spring-projects-issues
Copy link

Sascha Szott (Migrated from LDAP-319) said:

So far Spring LDAP does not support pagination in conjunction with LdapRepository (and its concrete subclasses). This makes it hard to use findAll in cases with more than 1000 result objects. Are there any plans to extend SimpleLdapRepository in order to support pagination?

@spring-projects-issues
Copy link
Author

Rob Winch said:

The reference states

Due to specifics of the LDAP protocol, paging and sorting is not supported for Spring LDAP repositories.

but I'm not familiar with the history of this. Perhaps [~ marthursson] can elaborate

@spring-projects-issues
Copy link
Author

Mattias Hellborg Arthursson said:

The problem with pagination in LDAP is that you need to re-use the exact same connection for each pagination request, or else the pagination control becomes invalid. This means that pagination like you're used to with "real" databases (as it is normally done in Spring repositories, using Pageable etc.) would very tricky to implement. We would need to figure out a way to make sure the same underlying LDAP connection would be re-used for each subsequent pagination request (which may or may not come). It would probably be possible to do, but my previous assessment has been that it would not be worth the effort.

As described in the [reference section on paged results | http://docs.spring.io/spring-ldap/docs/2.0.2.RELEASE/reference/#paged-search-results], the problem with re-using the same connection can be managed by wrapping all the pagination calls using SingleContextSource. While it would be perfectly possible to do provide additional methods in SimpleLdapRepository to do the operation outlined in the reference documentation this really wouldn't be paging: what we do here is more like buffering.

@spring-projects-issues
Copy link
Author

Rob Winch said:

Thanks for the response marthursson! What if we were able to include information in the response that could be passed in as an argument (similar to what page we are requesting)? Would that work?

@mehaksaini2811
Copy link

mehaksaini2811 commented Mar 17, 2021

I'm facing OperationNotSupportedException: [LDAP: error code 12 - 00000057: LdapErr: DSID-0C090B0B, comment: Error processing control, data 0, v3839 ]; remaining name
I've tried implementing it with doWithSingleContext but no luck. Surprisingly, it is bit inconsistent , it runs sometimes and fails rest of the time with no change in code.

@michael-o
Copy link

I have implemented this recently with pure JNDI and it worked for me with Active Directory and DirX. Does your directory server support this?

@mehaksaini2811
Copy link

I'm using Spring ldap rather than pure JNDI. Let me check it your way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants