View | Details | Raw Unified | Return to bug 57005
Collapse All | Expand All

(-)src/main/java/org/apache/tomcat/jdbc/pool/DataSource.java (-4 / +4 lines)
Lines 63-69 Link Here
63
    protected volatile ObjectName oname = null;
63
    protected volatile ObjectName oname = null;
64
64
65
    /**
65
    /**
66
     * Unregisters the underlying connection pool mbean.<br/>
66
     * Unregisters the underlying connection pool mbean.<br>
67
     * {@inheritDoc}
67
     * {@inheritDoc}
68
     */
68
     */
69
    @Override
69
    @Override
Lines 72-78 Link Here
72
    }
72
    }
73
73
74
    /**
74
    /**
75
     * no-op<br/>
75
     * no-op<br>
76
     * {@inheritDoc}
76
     * {@inheritDoc}
77
     */
77
     */
78
    @Override
78
    @Override
Lines 82-88 Link Here
82
82
83
83
84
    /**
84
    /**
85
     * no-op<br/>
85
     * no-op<br>
86
     * {@inheritDoc}
86
     * {@inheritDoc}
87
     */
87
     */
88
    @Override
88
    @Override
Lines 91-97 Link Here
91
    }
91
    }
92
92
93
    /**
93
    /**
94
     * If the connection pool MBean exists, it will be registered during this operation.<br/>
94
     * If the connection pool MBean exists, it will be registered during this operation.<br>
95
     * {@inheritDoc}
95
     * {@inheritDoc}
96
     */
96
     */
97
    @Override
97
    @Override
(-)src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java (-4 / +3 lines)
Lines 40-48 Link Here
40
 * <code>RefAddr</code> values of the specified <code>Reference</code>,
40
 * <code>RefAddr</code> values of the specified <code>Reference</code>,
41
 * which must match the names and data types of the
41
 * which must match the names and data types of the
42
 * <code>BasicDataSource</code> bean properties.</p>
42
 * <code>BasicDataSource</code> bean properties.</p>
43
 * <br/>
43
 * <br>
44
 * Properties available for configuration:<br/>
44
 * Properties available for configuration:<br>
45
 * <a href="http://commons.apache.org/dbcp/configuration.html">Commons DBCP properties</a><br/>
45
 * <a href="http://commons.apache.org/dbcp/configuration.html">Commons DBCP properties</a><br>
46
 *<ol>
46
 *<ol>
47
 *  <li>initSQL - A query that gets executed once, right after the connection is established.</li>
47
 *  <li>initSQL - A query that gets executed once, right after the connection is established.</li>
48
 *  <li>testOnConnect - run validationQuery after connection has been established.</li>
48
 *  <li>testOnConnect - run validationQuery after connection has been established.</li>
Lines 583-589 Link Here
583
     * <p>Parse properties from the string. Format of the string must be [propertyName=property;]*<p>
583
     * <p>Parse properties from the string. Format of the string must be [propertyName=property;]*<p>
584
     * @param propText
584
     * @param propText
585
     * @return Properties
585
     * @return Properties
586
     * @throws Exception
587
     */
586
     */
588
    protected static Properties getProperties(String propText) {
587
    protected static Properties getProperties(String propText) {
589
        return PoolProperties.getProperties(propText,null);
588
        return PoolProperties.getProperties(propText,null);
(-)src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java (-1 / +1 lines)
Lines 35-41 Link Here
35
 *
35
 *
36
 * The DataSource proxy lets us implements methods that don't exist in the current
36
 * The DataSource proxy lets us implements methods that don't exist in the current
37
 * compiler JDK but might be methods that are part of a future JDK DataSource interface.
37
 * compiler JDK but might be methods that are part of a future JDK DataSource interface.
38
 * <br/>
38
 * <br>
39
 * It's a trick to work around compiler issues when implementing interfaces. For example,
39
 * It's a trick to work around compiler issues when implementing interfaces. For example,
40
 * I could put in Java 6 methods of javax.sql.DataSource here, and compile it with JDK 1.5
40
 * I could put in Java 6 methods of javax.sql.DataSource here, and compile it with JDK 1.5
41
 * and still be able to run under Java 6 without getting NoSuchMethodException.
41
 * and still be able to run under Java 6 without getting NoSuchMethodException.
(-)src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java (-1 / +1 lines)
Lines 34-40 Link Here
34
 * invocations to method poll(...) will get handed out in the order they were received.
34
 * invocations to method poll(...) will get handed out in the order they were received.
35
 * Locking is fine grained, a shared lock is only used during the first level of contention, waiting is done in a
35
 * Locking is fine grained, a shared lock is only used during the first level of contention, waiting is done in a
36
 * lock per thread basis so that order is guaranteed once the thread goes into a suspended monitor state.
36
 * lock per thread basis so that order is guaranteed once the thread goes into a suspended monitor state.
37
 * <br/>
37
 * <br>
38
 * Not all of the methods of the {@link java.util.concurrent.BlockingQueue} are implemented.
38
 * Not all of the methods of the {@link java.util.concurrent.BlockingQueue} are implemented.
39
 *
39
 *
40
 */
40
 */
(-)src/main/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java (-2 / +2 lines)
Lines 26-32 Link Here
26
 * Abstract class that is to be extended for implementations of interceptors.
26
 * Abstract class that is to be extended for implementations of interceptors.
27
 * Everytime an operation is called on the {@link java.sql.Connection} object the
27
 * Everytime an operation is called on the {@link java.sql.Connection} object the
28
 * {@link #invoke(Object, Method, Object[])} method on the interceptor will be called.
28
 * {@link #invoke(Object, Method, Object[])} method on the interceptor will be called.
29
 * Interceptors are useful to change or improve behavior of the connection pool.<br/>
29
 * Interceptors are useful to change or improve behavior of the connection pool.<br>
30
 * Interceptors can receive a set of properties. Each sub class is responsible for parsing the properties during runtime when they
30
 * Interceptors can receive a set of properties. Each sub class is responsible for parsing the properties during runtime when they
31
 * are needed or simply override the {@link #setProperties(Map)} method.
31
 * are needed or simply override the {@link #setProperties(Map)} method.
32
 * Properties arrive in a key-value pair of Strings as they were received through the configuration.
32
 * Properties arrive in a key-value pair of Strings as they were received through the configuration.
Lines 155-161 Link Here
155
     * Gets called each time the connection is borrowed from the pool
155
     * Gets called each time the connection is borrowed from the pool
156
     * This means that if an interceptor holds a reference to the connection
156
     * This means that if an interceptor holds a reference to the connection
157
     * the interceptor can be reused for another connection.
157
     * the interceptor can be reused for another connection.
158
     * <br/>
158
     * <br>
159
     * This method may be called with null as both arguments when we are closing down the connection.
159
     * This method may be called with null as both arguments when we are closing down the connection.
160
     * @param parent - the connection pool owning the connection
160
     * @param parent - the connection pool owning the connection
161
     * @param con - the pooled connection
161
     * @param con - the pooled connection
(-)src/main/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java (-1 / +1 lines)
Lines 38-44 Link Here
38
 * invocations to method poll(...) will get handed out in the order they were received.
38
 * invocations to method poll(...) will get handed out in the order they were received.
39
 * Locking is fine grained, a shared lock is only used during the first level of contention, waiting is done in a
39
 * Locking is fine grained, a shared lock is only used during the first level of contention, waiting is done in a
40
 * lock per thread basis so that order is guaranteed once the thread goes into a suspended monitor state.
40
 * lock per thread basis so that order is guaranteed once the thread goes into a suspended monitor state.
41
 * <br/>
41
 * <br>
42
 * Not all of the methods of the {@link java.util.concurrent.BlockingQueue} are implemented.
42
 * Not all of the methods of the {@link java.util.concurrent.BlockingQueue} are implemented.
43
 *
43
 *
44
 */
44
 */
(-)src/main/java/org/apache/tomcat/jdbc/pool/PoolConfiguration.java (-8 / +8 lines)
Lines 86-92 Link Here
86
86
87
    /**
87
    /**
88
     * The connection properties that will be sent to the JDBC driver when establishing new connections.
88
     * The connection properties that will be sent to the JDBC driver when establishing new connections.
89
     * Format of the string is [propertyName=property;] <br/>
89
     * Format of the string is [propertyName=property;] <br>
90
     * NOTE - The "user" and "password" properties will be passed explicitly, so they do not need to be included here.
90
     * NOTE - The "user" and "password" properties will be passed explicitly, so they do not need to be included here.
91
     * The default value is null.
91
     * The default value is null.
92
     */
92
     */
Lines 665-676 Link Here
665
    /**
665
    /**
666
     * Returns true if the pool sweeper is enabled for the connection pool.
666
     * Returns true if the pool sweeper is enabled for the connection pool.
667
     * The pool sweeper is enabled if any settings that require async intervention in the pool are turned on
667
     * The pool sweeper is enabled if any settings that require async intervention in the pool are turned on
668
     * <source>
668
     * <code>
669
        boolean result = getTimeBetweenEvictionRunsMillis()>0;
669
        boolean result = getTimeBetweenEvictionRunsMillis()&gt;0;
670
        result = result && (isRemoveAbandoned() && getRemoveAbandonedTimeout()>0);
670
        result = result &amp;&amp; (isRemoveAbandoned() &amp;&amp; getRemoveAbandonedTimeout()&gt;0);
671
        result = result || (isTestWhileIdle() && getValidationQuery()!=null);
671
        result = result || (isTestWhileIdle() &amp;&amp; getValidationQuery()!=null);
672
        return result;
672
        return result;
673
       </source>
673
       </code>
674
     *
674
     *
675
     * @return true if a background thread is or will be enabled for this pool
675
     * @return true if a background thread is or will be enabled for this pool
676
     */
676
     */
Lines 698-704 Link Here
698
    /**
698
    /**
699
     * Time in milliseconds to keep this connection alive even when used.
699
     * Time in milliseconds to keep this connection alive even when used.
700
     * When a connection is returned to the pool, the pool will check to see if the
700
     * When a connection is returned to the pool, the pool will check to see if the
701
     * ((now - time-when-connected) > maxAge) has been reached, and if so,
701
     * ((now - time-when-connected) &gt; maxAge) has been reached, and if so,
702
     * it closes the connection rather than returning it to the pool.
702
     * it closes the connection rather than returning it to the pool.
703
     * The default value is 0, which implies that connections will be left open and no
703
     * The default value is 0, which implies that connections will be left open and no
704
     * age check will be done upon returning the connection to the pool.
704
     * age check will be done upon returning the connection to the pool.
Lines 711-717 Link Here
711
    /**
711
    /**
712
     * Time in milliseconds to keep this connection alive even when used.
712
     * Time in milliseconds to keep this connection alive even when used.
713
     * When a connection is returned to the pool, the pool will check to see if the
713
     * When a connection is returned to the pool, the pool will check to see if the
714
     * ((now - time-when-connected) > maxAge) has been reached, and if so,
714
     * ((now - time-when-connected) &gt; maxAge) has been reached, and if so,
715
     * it closes the connection rather than returning it to the pool.
715
     * it closes the connection rather than returning it to the pool.
716
     * The default value is 0, which implies that connections will be left open and no
716
     * The default value is 0, which implies that connections will be left open and no
717
     * age check will be done upon returning the connection to the pool.
717
     * age check will be done upon returning the connection to the pool.
(-)src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java (-1 / +1 lines)
Lines 526-532 Link Here
526
    }
526
    }
527
527
528
    /**
528
    /**
529
     * This method is called if (Now - timeCheckedIn > getReleaseTime())
529
     * This method is called if (Now - timeCheckedIn &gt; getReleaseTime())
530
     * This method disconnects the connection, logs an error in debug mode if it happens
530
     * This method disconnects the connection, logs an error in debug mode if it happens
531
     * then sets the {@link #released} flag to false. Any attempts to connect this cached object again
531
     * then sets the {@link #released} flag to false. Any attempts to connect this cached object again
532
     * will fail per {@link #connect()}
532
     * will fail per {@link #connect()}

Return to bug 57005