获取连接的key增加datasource维度
This commit is contained in:
parent
7b6ef60811
commit
cd83f506f2
0
APIJSONORM/build.sh
Normal file
0
APIJSONORM/build.sh
Normal file
@ -732,12 +732,13 @@ public abstract class AbstractSQLExecutor implements SQLExecutor {
|
||||
@NotNull
|
||||
@Override
|
||||
public Connection getConnection(@NotNull SQLConfig config) throws Exception {
|
||||
connection = connectionMap.get(config.getDatabase());
|
||||
String connectionKey = config.getDatasource() + "-" + config.getDatabase()
|
||||
connection = connectionMap.get(connectionKey);
|
||||
if (connection == null || connection.isClosed()) {
|
||||
Log.i(TAG, "select connection " + (connection == null ? " = null" : ("isClosed = " + connection.isClosed()))) ;
|
||||
// PostgreSQL 不允许 cross-database
|
||||
connection = DriverManager.getConnection(config.getDBUri(), config.getDBAccount(), config.getDBPassword());
|
||||
connectionMap.put(config.getDatabase(), connection);
|
||||
connectionMap.put(connectionKey, connection);
|
||||
}
|
||||
|
||||
int ti = getTransactionIsolation();
|
||||
|
Loading…
Reference in New Issue
Block a user