File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
APIJSONORM/src/main/java/apijson/orm Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1284,16 +1284,24 @@ public Map<String, Connection> getConnectionMap() {
12841284 }
12851285
12861286 protected Connection connection ;
1287+ @ NotNull
1288+ public Connection getConnection (String key ) throws Exception {
1289+ return getConnectionMap ().get (key );
1290+ }
1291+ public Connection putConnection (String key , Connection connection ) throws Exception {
1292+ return getConnectionMap ().put (key , connection );
1293+ }
1294+
12871295 @ NotNull
12881296 @ Override
12891297 public Connection getConnection (@ NotNull SQLConfig <T , M , L > config ) throws Exception {
12901298 String connectionKey = getConnectionKey (config );
1291- connection = getConnectionMap (). get (connectionKey );
1299+ connection = getConnection (connectionKey );
12921300 if (connection == null || connection .isClosed ()) {
12931301 Log .i (TAG , "select connection " + (connection == null ? " = null" : ("isClosed = " + connection .isClosed ()))) ;
12941302 // PostgreSQL 不允许 cross-database
12951303 connection = DriverManager .getConnection (config .gainDBUri (), config .gainDBAccount (), config .gainDBPassword ());
1296- getConnectionMap (). put (connectionKey , connection );
1304+ putConnection (connectionKey , connection );
12971305 }
12981306
12991307 // TDengine 驱动内部事务处理方法都是空实现,手动 commit 无效
You can’t perform that action at this time.
0 commit comments