git-svn-id: http://code.alibabatech.com/svn/druid/trunk@462 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-07-17 09:09:50 +00:00
parent eb78e0fc06
commit 6c2937cd42
2 changed files with 3 additions and 3 deletions
@@ -54,7 +54,7 @@ public class HAConnection extends WrapperAdapter implements Connection, Connecti
public void checkConnection(String sql) throws SQLException {
if (conn == null) {
conn = haDataSource.getConnectionInternal(id);
conn = haDataSource.getConnectionInternal(id, sql);
}
if (autoCommit != null) {
@@ -36,7 +36,7 @@ public class HADataSource extends MultiDataSource implements DataSource {
return statementIdSeed.getAndIncrement();
}
public Connection getConnectionInternal(int requestNumber) throws SQLException {
public Connection getConnectionInternal(int connectionId, String sql) throws SQLException {
int tryCount = 0;
for (;;) {
@@ -46,7 +46,7 @@ public class HADataSource extends MultiDataSource implements DataSource {
throw new SQLException("can not get connection, no availabe datasources");
}
int index = requestNumber % size;
int index = connectionId % size;
DruidDataSource dataSource = null;