fix: properly disconnect agent-based database connections
PoolKind::Agent had a no-op disconnect handler, which meant closing connections for agent-driven databases (KingbaseES, Oracle, Dameng, etc.) never actually sent a disconnect command to the Java agent process. The JDBC connection was only released when the process was eventually killed via Drop, which could leave stale sessions alive on reconnect.
This commit is contained in:
@@ -482,7 +482,10 @@ pub async fn disconnect_db(state: State<'_, Arc<AppState>>, connection_id: Strin
|
||||
PoolKind::ClickHouse(_) => {}
|
||||
PoolKind::SqlServer(_) => {}
|
||||
PoolKind::Elasticsearch(_) => {}
|
||||
PoolKind::Agent(_) => {}
|
||||
PoolKind::Agent(client) => {
|
||||
let mut client = client.lock().await;
|
||||
let _ = client.disconnect().await;
|
||||
}
|
||||
PoolKind::ExternalTabular(_) => {}
|
||||
PoolKind::ExternalDriver { .. } => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user