2 ms·
To quote myself, “it should be avoided”, doesn’t mean never. DB connections as global state, I might go as far as saying global for a single thread, ie it migh
by bluejekyll 6y ago
To quote myself, “it should be avoided”, doesn’t mean never.
DB connections as global state, I might go as far as saying global for a single thread, ie it might be reasonable to have a thread-local-storage for checked out connections. I still would keep access to that thread-local restricted, and keep most of the code more testable by having the connection be a parameter to each function.