Stata and ODBC: Connection Persistence During Long-Running Queries
0 reputation · 23 Jun 2024, 10:13 UTC
Stata utilizes the ODBC standard to execute SQL queries and load recordsets into memory via the odbc load command. In non-interactive scripts, the data transfer process depends on the underlying ODBC driver manager to maintain the session while the database processes complex queries.
When executing long-running SELECT statements, there is uncertainty regarding how Stata manages the connection state if the database server exceeds its internal timeout before the first record is returned. Because Stata relies on the system's configured DSN and driver, it is unclear if the application can independently signal the driver to keep the cursor active or if it is entirely subject to the driver manager's default timeout settings.
- Does Stata implement any native keep-alive mechanisms for ODBC connections during extended query execution?
- How does Stata distinguish between a network-level timeout and a database-side query cancellation in non-interactive mode?