Method shrinkage to try to get below inline threshold.

pull/1/head
Brett Wooldridge 11 years ago
parent a2eee447b2
commit 52dec2f2f5

@ -184,7 +184,7 @@ public class HikariPool implements HikariPoolMBean
{
if (!connectionProxy.isBrokenConnection())
{
connectionProxy.setLastAccess(System.currentTimeMillis());
connectionProxy.markLastAccess();
idleConnectionCount.incrementAndGet();
idleConnections.put(connectionProxy);
}

@ -50,8 +50,7 @@ public class ConnectionProxy extends HikariProxyBase implements IHikariConnectio
{
private static ProxyFactory PROXY_FACTORY;
@HikariInject private static final Set<String> POSTGRESQL_ERRORS;
@HikariInject private static final Set<String> SPECIAL_ERRORS;
@HikariInject private static final Set<String> SQL_ERRORS;
@HikariInject private ArrayList<Statement> _openStatements;
@HikariInject private volatile boolean _isClosed;
@ -69,14 +68,12 @@ public class ConnectionProxy extends HikariProxyBase implements IHikariConnectio
// static initializer
static
{
POSTGRESQL_ERRORS = new HashSet<String>();
POSTGRESQL_ERRORS.add("57P01"); // ADMIN SHUTDOWN
POSTGRESQL_ERRORS.add("57P02"); // CRASH SHUTDOWN
POSTGRESQL_ERRORS.add("57P03"); // CANNOT CONNECT NOW
POSTGRESQL_ERRORS.add("57P02"); // CRASH SHUTDOWN
SPECIAL_ERRORS = new HashSet<String>();
SPECIAL_ERRORS.add("01002"); // SQL92 disconnect error
SQL_ERRORS = new HashSet<String>();
SQL_ERRORS.add("57P01"); // ADMIN SHUTDOWN
SQL_ERRORS.add("57P02"); // CRASH SHUTDOWN
SQL_ERRORS.add("57P03"); // CANNOT CONNECT NOW
SQL_ERRORS.add("57P02"); // CRASH SHUTDOWN
SQL_ERRORS.add("01002"); // SQL92 disconnect error
__static();
}
@ -114,9 +111,9 @@ public class ConnectionProxy extends HikariProxyBase implements IHikariConnectio
}
@HikariInject
public void setLastAccess(long timestamp)
public void markLastAccess()
{
this._lastAccess = timestamp;
this._lastAccess = System.currentTimeMillis();
}
@HikariInject
@ -152,22 +149,12 @@ public class ConnectionProxy extends HikariProxyBase implements IHikariConnectio
public SQLException checkException(SQLException sqle)
{
String sqlState = sqle.getSQLState();
if (sqlState == null)
{
return sqle;
}
sqlState = sqlState.toUpperCase();
if (sqlState.startsWith("08"))
{
_forceClose = true;
}
else if (POSTGRESQL_ERRORS.contains(sqlState.toUpperCase()) || SPECIAL_ERRORS.contains(sqlState))
if (sqlState != null)
{
_forceClose = true;
_forceClose |= sqlState.startsWith("08") | SQL_ERRORS.contains(sqlState);
}
return sqle;
return sqle;
}
@HikariInject

@ -42,7 +42,7 @@ public interface IHikariConnectionProxy
long getLastAccess();
void setLastAccess(long timestamp);
void markLastAccess();
void setParentPool(HikariPool parentPool);

Loading…
Cancel
Save