Minor cleanup.

pull/77/head
Brett Wooldridge 11 years ago
parent 12d9de5cfe
commit 719da54897

@ -77,7 +77,6 @@ public class HikariConfig implements HikariConfigMBean
private Properties dataSourceProperties;
private int transactionIsolation;
static
{
JavassistProxyFactory.initialize();
@ -112,7 +111,6 @@ public class HikariConfig implements HikariConfigMBean
PropertyBeanSetter.setTargetFromProperties(this, properties);
}
/**
* Construct a HikariConfig from the specified property file name.
*
@ -740,9 +738,12 @@ public class HikariConfig implements HikariConfigMBean
if (!Modifier.isFinal(field.getModifiers()))
{
field.setAccessible(true);
try {
try
{
field.set(other, field.get(this));
} catch (Exception e) {
}
catch (Exception e)
{
throw new RuntimeException("Exception copying HikariConfig state: " + e.getMessage(), e);
}
}

@ -196,8 +196,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
}
/**
* Release a connection back to the pool, or permanently close it if it
* is broken.
* Release a connection back to the pool, or permanently close it if it is broken.
*
* @param connectionProxy the connection to release back to the pool
*/
@ -297,22 +296,13 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
{
int sleepBackoff = 200;
final int maxPoolSize = configuration.getMaximumPoolSize();
while (totalConnections.get() < maxPoolSize)
{
final int minIdle = configuration.getMinimumIdle();
if (minIdle != 0 && getIdleConnections() >= minIdle)
while (totalConnections.get() < maxPoolSize && (minIdle == 0 || getIdleConnections() < minIdle))
{
break;
}
else if (!addConnection())
if (!addConnection())
{
PoolUtilities.quietlySleep(sleepBackoff);
sleepBackoff = (int) Math.min(1000f, ((float) sleepBackoff) * 1.5);
if (getThreadsAwaitingConnection() == 0)
{
lastConnectionFailure.set(null);
break;
}
continue;
}

Loading…
Cancel
Save