Added setter method to allow connection pooling to be disabled.

This commit is contained in:
Luke Taylor 2006-01-25 17:04:02 +00:00
parent ab0c24bd97
commit fe2f4e4a3b

View File

@ -51,8 +51,8 @@ import org.apache.commons.logging.LogFactory;
* that user. * that user.
* </p> * </p>
* <p> * <p>
* Connection pooling is enabled for anonymous or manager connections, but not when binding * Connection pooling is enabled by default for anonymous or manager connections, but
* as a specific user. * not when binding as a specific user.
* </p> * </p>
* *
* @see <a href="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">The Java * @see <a href="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">The Java
@ -281,4 +281,15 @@ public class DefaultInitialDirContextFactory implements InitialDirContextFactory
public void setMessageSource(MessageSource messageSource) { public void setMessageSource(MessageSource messageSource) {
this.messages = new MessageSourceAccessor(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;
}
} }