garydgregory commented on a change in pull request #50:
URL: https://github.com/apache/commons-dbcp/pull/50#discussion_r468123812
##########
File path: src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
##########
@@ -433,6 +433,55 @@ public synchronized void close() throws SQLException {
}
}
+ /**
+ * Starts the datasource.
+ * <p>
+ * It is not necessary to call this method before using a newly created
BasicDataSource instance, but
+ * calling it in that context causes the datasource to be immediately
initialized (instead of waiting for
+ * the first {@link #getConnection()} request). Its primary use is to
restart and reinitialize a
+ * datasource that has been closed.
+ * <p>
+ * When this method is called after {@link #close()}, connections checked
out by clients
+ * before the datasource was stopped do not count in {@link
#getMaxTotal()} or {@link #getNumActive()}.
+ * For example, if there are 3 connections checked out by clients when
{@link #close()} is invoked and they are
+ * not returned before {@link #start()} is invoked, after this method is
called, {@link #getNumActive()} will
+ * return 0. These connections will be physically closed when they are
returned, but they will not count against
+ * the maximum allowed in the newly started datasource.
+ *
+ * @throws SQLException if an error occurs initializing the datasource
+ */
+ @Override
+ public synchronized void start() throws SQLException {
Review comment:
Ok sounds good.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]