microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.55k stars 899 forks source link

Connection to database remains open. #25657

Closed akc42 closed 4 months ago

akc42 commented 4 months ago

Type: Bug

I do a lot of development work on a database called PAS_Live. However as part of a backup script I drop the database before recreating it from a backup file created on the production system (another computer entirely).

Although the only tab open is the one with the backup script, and that is either totally disconnected or connected to the "Master" database a run sometimes fails because it cannot drop the database.

Opening a tab with the Master connection and running EXEC sp_who2 often shows a remaining connection to PAS_Live from Azdata (which I assume is Azure Data Studio). I have to kill that connection for my backup to work

Azure Data Studio version: azuredatastudio 1.48.0 (4970733324ef8254b7c22a5dc55af7f8a1dea93f, 2024-02-26T20:54:08.538Z) OS version: Linux x64 6.1.0-21-amd64 Restricted Mode: No Preview Features: Enabled Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900HX with Radeon Graphics (16 x 3600)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|30.75GB (23.52GB free)| |Process Argv|--unity-launch| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|gnome| |XDG_CURRENT_DESKTOP|GNOME| |XDG_SESSION_DESKTOP|gnome| |XDG_SESSION_TYPE|wayland|
Extensions: none
cheenamalhotra commented 4 months ago

You can disable connection pooling, as connections maybe getting pooled.. Find in settings: image

Or execute Clear Pooled Connections command, for the same.

Read more about this here

akc42 commented 4 months ago

Thanks solved my problem