Hi Community,
I’m working on a project in Ignition Perspective (v8.1.38) where I need to safely delete a database connection through a user interface.
Before allowing a user to delete a database connection (for example, ignition_test
), I want to programmatically check if the connection is actively in use — meaning if other sessions, users, or running scripts are currently utilizing that connection.
Here’s what I’ve discovered so far:
system.db.getConnectionInfo(connectionName)
provides the connection status (Valid
orFaulted
), but it doesn’t provide details on active or idle connection counts.- The active connection pool statistics are visible in Gateway > Status > Connections > Databases, but I couldn’t find a scripting function to access this data.
What I’m trying to achieve:
Programmatically determine if a database connection is actively in use (for example, via connection pool usage or ongoing queries)
Prevent deletion if the connection is currently active or busy
Questions:
- Is there a way to programmatically check active or idle connection counts in Ignition Perspective scripting?
- Is there a built-in mechanism to safely handle connection deletion if it is currently in use?
- If this is not accessible through scripting, is there any recommended best practice to handle this scenario?
Context:
- Ignition Version: 8.1.38
- Scope: Perspective
- Database Type: MSSQL (but applicable to any)