SQLBot Version
1.10.0
Run Mode
Is it running in a Docker container or running from source code?
1panel
Describe the bug
数据源是微软sqlserver 2019,添加数据源正常,但是几小时后,数据源预览会报错,直接对数据源问答也不报错,但是在maxkb 通过MCP调用sqlbot 数据源问答会报一样的错误。请看看是不是缓存连接池的问题,请优化一下!

ERROR:{"message":"Execute SQL Failed","traceback":"Traceback (most recent call last):\n File "/opt/sqlbot/app/apps/chat/task/llm.py", line 1183, in execute_sql\n return exec_sql(ds=self.ds, sql=sql, origin_column=False)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsqlalchemy.orm.exc.DetachedInstanceError: Instance <CoreDatasource at 0x7b7e4a62b110> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)\n","type":"exec-sql-err"}
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
SQLBot Version
1.10.0
Run Mode
Is it running in a Docker container or running from source code?
1panel
Describe the bug

数据源是微软sqlserver 2019,添加数据源正常,但是几小时后,数据源预览会报错,直接对数据源问答也不报错,但是在maxkb 通过MCP调用sqlbot 数据源问答会报一样的错误。请看看是不是缓存连接池的问题,请优化一下!
ERROR:{"message":"Execute SQL Failed","traceback":"Traceback (most recent call last):\n File "/opt/sqlbot/app/apps/chat/task/llm.py", line 1183, in execute_sql\n return exec_sql(ds=self.ds, sql=sql, origin_column=False)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsqlalchemy.orm.exc.DetachedInstanceError: Instance <CoreDatasource at 0x7b7e4a62b110> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)\n","type":"exec-sql-err"}
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.