bug fixed for dataSource.restart()

This commit is contained in:
wenshao
2014-09-24 00:55:04 +08:00
parent f500cc0eee
commit 7cc45ad594
2 changed files with 28 additions and 6 deletions
@@ -286,9 +286,12 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
return discardCount;
}
public void restart() {
public void restart() throws SQLException {
lock.lock();
try {
if (activeCount > 0) {
throw new SQLException("can not restart, activeCount not zero. " + activeCount);
}
if (LOG.isInfoEnabled()) {
LOG.info("{dataSource-" + this.getID() + "} restart");
}