The PoolingContextSource
assumes that all
DirContext
objects retrieved from
ContextSource.getReadOnlyContext()
will have
the same environment and likewise that all
DirContext
objects retrieved from
ContextSource.getReadWriteContext()
will
have the same environment. This means that wrapping a
LdapContextSource
configured with an
AuthenticationSource
in a
PoolingContextSource
will not function
as expected. The pool would be populated using the credentials
of the first user and unless new connections were needed
subsequent context requests would not be filled for the user
specified by the AuthenticationSource
for
the requesting thread.