Search in sources :

Example 1 with AbandonedConfig

use of org.apache.commons.pool2.impl.AbandonedConfig in project datanucleus-rdbms by datanucleus.

the class BasicDataSource method setRemoveAbandonedOnMaintenance.

/**
 * @param removeAbandonedOnMaintenance true means abandoned connections may be removed on pool maintenance.
 * @see #getRemoveAbandonedOnMaintenance()
 */
public void setRemoveAbandonedOnMaintenance(final boolean removeAbandonedOnMaintenance) {
    if (abandonedConfig == null) {
        abandonedConfig = new AbandonedConfig();
    }
    abandonedConfig.setRemoveAbandonedOnMaintenance(removeAbandonedOnMaintenance);
    final GenericObjectPool<?> gop = this.connectionPool;
    if (gop != null) {
        gop.setAbandonedConfig(abandonedConfig);
    }
}
Also used : AbandonedConfig(org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.AbandonedConfig)

Example 2 with AbandonedConfig

use of org.apache.commons.pool2.impl.AbandonedConfig in project datanucleus-rdbms by datanucleus.

the class BasicDataSource method setLogAbandoned.

/**
 * @param logAbandoned new logAbandoned property value
 */
public void setLogAbandoned(final boolean logAbandoned) {
    if (abandonedConfig == null) {
        abandonedConfig = new AbandonedConfig();
    }
    abandonedConfig.setLogAbandoned(logAbandoned);
    final GenericObjectPool<?> gop = this.connectionPool;
    if (gop != null) {
        gop.setAbandonedConfig(abandonedConfig);
    }
}
Also used : AbandonedConfig(org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.AbandonedConfig)

Example 3 with AbandonedConfig

use of org.apache.commons.pool2.impl.AbandonedConfig in project tomcat by apache.

the class BasicDataSource method setRemoveAbandonedTimeout.

/**
 * Sets the timeout before an abandoned connection can be removed.
 * <p>
 * Setting this property has no effect if {@link #getRemoveAbandonedOnBorrow()} and
 * {code getRemoveAbandonedOnMaintenance()} are false.
 * </p>
 *
 * @param removeAbandonedTimeout new abandoned timeout
 * @see #getRemoveAbandonedTimeoutDuration()
 * @see #getRemoveAbandonedOnBorrow()
 * @see #getRemoveAbandonedOnMaintenance()
 * @since 2.10.0
 */
public void setRemoveAbandonedTimeout(final Duration removeAbandonedTimeout) {
    if (abandonedConfig == null) {
        abandonedConfig = new AbandonedConfig();
    }
    abandonedConfig.setRemoveAbandonedTimeout(removeAbandonedTimeout);
    final GenericObjectPool<?> gop = this.connectionPool;
    if (gop != null) {
        gop.setAbandonedConfig(abandonedConfig);
    }
}
Also used : AbandonedConfig(org.apache.tomcat.dbcp.pool2.impl.AbandonedConfig)

Example 4 with AbandonedConfig

use of org.apache.commons.pool2.impl.AbandonedConfig in project tomcat by apache.

the class BasicDataSource method setAbandonedLogWriter.

/**
 * Sets the print writer to be used by this configuration to log information on abandoned objects.
 *
 * @param logWriter The new log writer
 */
public void setAbandonedLogWriter(final PrintWriter logWriter) {
    if (abandonedConfig == null) {
        abandonedConfig = new AbandonedConfig();
    }
    abandonedConfig.setLogWriter(logWriter);
    final GenericObjectPool<?> gop = this.connectionPool;
    if (gop != null) {
        gop.setAbandonedConfig(abandonedConfig);
    }
}
Also used : AbandonedConfig(org.apache.tomcat.dbcp.pool2.impl.AbandonedConfig)

Example 5 with AbandonedConfig

use of org.apache.commons.pool2.impl.AbandonedConfig in project ddf by codice.

the class LdapLoginConfig method createGenericPoolAbandonConfig.

private AbandonedConfig createGenericPoolAbandonConfig() {
    AbandonedConfig abandonedConfig = new AbandonedConfig();
    abandonedConfig.setRemoveAbandonedOnBorrow(true);
    abandonedConfig.setRemoveAbandonedTimeout(FIVE_MIN_S);
    return abandonedConfig;
}
Also used : AbandonedConfig(org.apache.commons.pool2.impl.AbandonedConfig)

Aggregations

AbandonedConfig (org.apache.tomcat.dbcp.pool2.impl.AbandonedConfig)7 AbandonedConfig (org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.AbandonedConfig)6 AbandonedConfig (org.apache.commons.pool2.impl.AbandonedConfig)1