Skip to content

Commit d7ff9ff

Browse files
authored
Update td_connect.py (#312)
pool_pre_ping=True tells SQLAlchemy to issue a lightweight SELECT 1 before returning any connection from the pool. When a transient Teradata instance restarts, stale pooled connections are detected and discarded automatically — the next tool call gets a fresh connection and succeeds without the agent or user seeing any error. Really useful when using Teradata Trial instances.
1 parent 6500b97 commit d7ff9ff

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/teradata_mcp_server/tools/td_connect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def __init__(self, settings: Optional["Settings"] = None):
115115
pool_size=pool_size,
116116
max_overflow=max_overflow,
117117
pool_timeout=pool_timeout,
118+
pool_pre_ping=True,
118119
)
119120
logger.info(f"SQLAlchemy engine created for Teradata: {self._base_host}:{self._base_port}/{self._base_db}")
120121
except Exception as e:

0 commit comments

Comments
 (0)