☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

SQLAlchemy session management

Community Support
Meir_Tseitlin
Meir_Tseitlin

Hi,

I am using Bokeh server with SQL datasource - data is pulled from DB and updated via bokeh callback on frontend. I use Flask with flask-sqlalchemy for accessing DB.

For now SQLAlchemy session stays open from the moment bokeh was loaded on frontend up until the page is closed (actually some time after).

It’s healthy (as I have idle - transactions in Postgres). I am willing to switch this mechanism to be “request” based (similar to how Flask is working) - each bokeh callback - a new SQLAlchemy session will be opened and terminated afterwards.

Any ideas how to do it?

Thanks

⌁   Link to post

End of archived discussion · Replies are disabled