/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @see #getTimeBetweenEvictionRunsMillis */ public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) { assertInitializationAllowed(); _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; }
/** * Set the value of defaultAutoCommit, which defines the state of * connections handed out from this pool. The value can be changed * on the Connection using Connection.setAutoCommit(boolean). * The default is true. * * @param v Value to assign to defaultAutoCommit. */ public void setDefaultAutoCommit(boolean v) { assertInitializationAllowed(); this.defaultAutoCommit = v; }
/** * Set the value of defaultReadOnly, which defines the state of * connections handed out from this pool. The value can be changed * on the Connection using Connection.setReadOnly(boolean). * The default is false. * * @param v Value to assign to defaultReadOnly. */ public void setDefaultReadOnly(boolean v) { assertInitializationAllowed(); this.defaultReadOnly = v; }
/** * Set the value of defaultReadOnly, which defines the state of * connections handed out from this pool. The value can be changed * on the Connection using Connection.setReadOnly(boolean). * The default is false. * * @param v Value to assign to defaultReadOnly. */ public void setDefaultReadOnly(boolean v) { assertInitializationAllowed(); this.defaultReadOnly = v; }
/** * Set the value of defaultAutoCommit, which defines the state of * connections handed out from this pool. The value can be changed * on the Connection using Connection.setAutoCommit(boolean). * The default is true. * * @param v Value to assign to defaultAutoCommit. */ public void setDefaultAutoCommit(boolean v) { assertInitializationAllowed(); this.defaultAutoCommit = v; }
/** * Set the value of defaultReadOnly, which defines the state of * connections handed out from this pool. The value can be changed * on the Connection using Connection.setReadOnly(boolean). * The default is false. * * @param v Value to assign to defaultReadOnly. */ public void setDefaultReadOnly(boolean v) { assertInitializationAllowed(); this.defaultReadOnly = v; }
/** * Set the value of defaultAutoCommit, which defines the state of * connections handed out from this pool. The value can be changed * on the Connection using Connection.setAutoCommit(boolean). * The default is true. * * @param v Value to assign to defaultAutoCommit. */ public void setDefaultAutoCommit(boolean v) { assertInitializationAllowed(); this.defaultAutoCommit = v; }
/** * Sets the minimum amount of time an object may sit idle in the pool * before it is eligable for eviction by the idle object evictor * (if any). * When non-positive, no objects will be evicted from the pool * due to idle time alone. * * @see #getMinEvictableIdleTimeMillis * @see #setTimeBetweenEvictionRunsMillis */ public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) { assertInitializationAllowed(); _minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; }
/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @see #getTimeBetweenEvictionRunsMillis */ public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) { assertInitializationAllowed(); _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; }
/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @see #getTimeBetweenEvictionRunsMillis */ public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) { assertInitializationAllowed(); _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; }
/** * Sets the minimum amount of time an object may sit idle in the pool * before it is eligable for eviction by the idle object evictor * (if any). * When non-positive, no objects will be evicted from the pool * due to idle time alone. * * @see #getMinEvictableIdleTimeMillis * @see #setTimeBetweenEvictionRunsMillis */ public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) { assertInitializationAllowed(); _minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; }
/** * When <tt>true</tt>, objects will be * {*link PoolableObjectFactory#validateObject validated} * by the idle object evictor (if any). If an object * fails to validate, it will be dropped from the pool. For a * <code>true</code> value to have any effect, * the <code>validationQuery</code> property must be set to a non-null * string. * * @see #getTestWhileIdle * @see #setTimeBetweenEvictionRunsMillis */ public void setTestWhileIdle(boolean testWhileIdle) { assertInitializationAllowed(); _testWhileIdle = testWhileIdle; testPositionSet = true; }
/** * Whether a rollback will be issued after executing the SQL query * that will be used to validate connections from this pool * before returning them to the caller. Default behavior is NOT * to issue a rollback. The setting will only have an effect * if a validation query is set * * @param rollbackAfterValidation new property value * @since 1.2.2 */ public void setRollbackAfterValidation(boolean rollbackAfterValidation) { assertInitializationAllowed(); this.rollbackAfterValidation = rollbackAfterValidation; }
/** * Whether a rollback will be issued after executing the SQL query * that will be used to validate connections from this pool * before returning them to the caller. Default behavior is NOT * to issue a rollback. The setting will only have an effect * if a validation query is set * * @param rollbackAfterValidation new property value * @since 1.2.2 */ public void setRollbackAfterValidation(boolean rollbackAfterValidation) { assertInitializationAllowed(); this.rollbackAfterValidation = rollbackAfterValidation; }
/** * Sets the minimum amount of time an object may sit idle in the pool * before it is eligable for eviction by the idle object evictor * (if any). * When non-positive, no objects will be evicted from the pool * due to idle time alone. * * @see #getMinEvictableIdleTimeMillis * @see #setTimeBetweenEvictionRunsMillis */ public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) { assertInitializationAllowed(); _minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; }
/** * Whether a rollback will be issued after executing the SQL query * that will be used to validate connections from this pool * before returning them to the caller. Default behavior is NOT * to issue a rollback. The setting will only have an effect * if a validation query is set * * @param rollbackAfterValidation new property value * @since 1.2.2 */ public void setRollbackAfterValidation(boolean rollbackAfterValidation) { assertInitializationAllowed(); this.rollbackAfterValidation = rollbackAfterValidation; }
/** * Sets the number of objects to examine during each run of the * idle object evictor thread (if any). * <p> * When a negative value is supplied, <tt>ceil({*link #numIdle})/abs({*link #getNumTestsPerEvictionRun})</tt> * tests will be run. I.e., when the value is <i>-n</i>, roughly one <i>n</i>th of the * idle objects will be tested per run. * * @see #getNumTestsPerEvictionRun * @see #setTimeBetweenEvictionRunsMillis */ public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) { assertInitializationAllowed(); _numTestsPerEvictionRun = numTestsPerEvictionRun; }
/** * The SQL query that will be used to validate connections from this pool * before returning them to the caller. If specified, this query * <strong>MUST</strong> be an SQL SELECT statement that returns at least * one row. If none of the properties, testOnBorow, testOnReturn, testWhileIdle * have been previously set, calling this method sets testOnBorrow to true. */ public void setValidationQuery(String validationQuery) { assertInitializationAllowed(); this.validationQuery = validationQuery; if (!testPositionSet) { setTestOnBorrow(true); } }
/** * The SQL query that will be used to validate connections from this pool * before returning them to the caller. If specified, this query * <strong>MUST</strong> be an SQL SELECT statement that returns at least * one row. Default behavior is to test the connection when it is * borrowed. */ public void setValidationQuery(String validationQuery) { assertInitializationAllowed(); this.validationQuery = validationQuery; if (!testPositionSet) { setTestOnBorrow(true); } }
/** * The SQL query that will be used to validate connections from this pool * before returning them to the caller. If specified, this query * <strong>MUST</strong> be an SQL SELECT statement that returns at least * one row. If none of the properties, testOnBorow, testOnReturn, testWhileIdle * have been previously set, calling this method sets testOnBorrow to true. */ public void setValidationQuery(String validationQuery) { assertInitializationAllowed(); this.validationQuery = validationQuery; if (!testPositionSet) { setTestOnBorrow(true); } }