From fe2f4e4a3bd2888a3ee82e602955d8c60ecb1bf5 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Wed, 25 Jan 2006 17:04:02 +0000 Subject: [PATCH] Added setter method to allow connection pooling to be disabled. --- .../ldap/DefaultInitialDirContextFactory.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/acegisecurity/providers/ldap/DefaultInitialDirContextFactory.java b/core/src/main/java/org/acegisecurity/providers/ldap/DefaultInitialDirContextFactory.java index 2798fe27cc..b9c5b3c31b 100644 --- a/core/src/main/java/org/acegisecurity/providers/ldap/DefaultInitialDirContextFactory.java +++ b/core/src/main/java/org/acegisecurity/providers/ldap/DefaultInitialDirContextFactory.java @@ -51,8 +51,8 @@ import org.apache.commons.logging.LogFactory; * that user. *

*

- * Connection pooling is enabled for anonymous or manager connections, but not when binding - * as a specific user. + * Connection pooling is enabled by default for anonymous or manager connections, but + * not when binding as a specific user. *

* * @see The Java @@ -281,4 +281,15 @@ public class DefaultInitialDirContextFactory implements InitialDirContextFactory public void setMessageSource(MessageSource messageSource) { this.messages = new MessageSourceAccessor(messageSource); } + + /** + * Connection pooling is enabled by default for anonymous or "manager" + * connections when using the default Sun provider. To disable all + * connection pooling, set this property to false. + * + * @param useConnectionPool whether to pool connections for non-specific users. + */ + public void setUseConnectionPool(boolean useConnectionPool) { + this.useConnectionPool = useConnectionPool; + } }