micro refactor
This commit is contained in:
parent
68909c3102
commit
cc2e24afbd
2 changed files with 3 additions and 1 deletions
|
|
@ -12,7 +12,6 @@ import org.jooq.Record;
|
||||||
import org.jooq.impl.*;
|
import org.jooq.impl.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Connection;
|
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
private static final Logger logger = Logger.getLogger(Main.class);
|
private static final Logger logger = Logger.getLogger(Main.class);
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ public class DBPool implements ConnectionProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable Connection acquire() throws DataAccessException {
|
public @Nullable Connection acquire() throws DataAccessException {
|
||||||
|
logger.debug("acquire");
|
||||||
DBConnection conn;
|
DBConnection conn;
|
||||||
try {
|
try {
|
||||||
conn = connections
|
conn = connections
|
||||||
|
|
@ -87,6 +88,8 @@ public class DBPool implements ConnectionProvider {
|
||||||
if (connections.size() > POOL_LOW_CAP) {
|
if (connections.size() > POOL_LOW_CAP) {
|
||||||
connections.remove(db);
|
connections.remove(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.debug(String.format("release %s", db.toString()));
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
throw new DataAccessException("connection is not present in pool");
|
throw new DataAccessException("connection is not present in pool");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue