Closed ghost closed 5 years ago
Thanks for pointing this out, I'll update the documentation in development branch to include an example with DBSessionRemoverMiddleware
.
This is now documented properly: https://turbogears.readthedocs.io/en/latest/cookbook/multiple-databases.html#change-the-way-your-app-loads-the-database-engines
If I have multiple databases with multiple sessions, do I need a separate DBSessionRemoverMiddleware added to the app for each of the sessions?
Currently AppConfig adds DBSessionRemoverMiddleware to only one session.
` def _add_sqlalchemy_middleware(self, conf, app): """Set up middleware that cleans up the sqlalchemy session.
If I should attach DBSessionRemoverMiddleware to each session, what is the best way to do this? Should I overwrite the _add_sqlalchemy_middleware function of AppConfig?
Can you provide a link to a working example of latest 2.3.10 Turbogears configured with multiple databases?