CakePHP 3 - ConnectionManager::config and persisting connection configuration.
I have a need to, in addition to the default DB connection (from app.php) , add another DB connection specific to the client. Ie every client ends up with 2 connections and depending on where data needs to be retrieved from, the app sets the defaultConnectionName() in the relevant Table object.
I am currently loading the 2nd connection info based on the logged in user, on the fly, using ConnectionManager::config(). This works well. However what I've noticed is that the app loads the connection info every time the user makes a request. Would there be a way to persist this connection information between requests, short of storing connection info in Session? Having said that I did also notice that bootstrap gets called for every request - loading the 'default' connection information anyway.