Skip to main content

Disconnect

Closes and disconnects from a SQLite database connection.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The identifier of the connection to disconnect.

How It Works

The Disconnect node closes and removes a SQLite database connection from the connection pool. When executed, the node:

  1. Validates the provided Connection Id input
  2. Acquires a mutex lock to ensure thread safety
  3. Looks up the connection in the SQLite connection pool
  4. Throws an error if the connection is not found
  5. Closes the database connection
  6. Removes the connection from the SQLite connection pool
  7. Releases the mutex lock

Requirements

  • A valid connection identifier from a previously established SQLite connection
  • The connection must still be active

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection Id
  • Connection with the specified Id not found
  • Database connection is already closed

Usage Notes

  • The Connection Id should match the one returned by the Connect node
  • Always disconnect connections when they are no longer needed to free up resources
  • This node should be used at the end of database operations
  • Ensure all transactions are committed or rolled back before disconnecting