Using multiple databases for an application

Alright, sounds fair.

But why can I enable multiple databases per application then? And why does it automatically work with the first database I connect? I can’t implement additional code to the current functionality. Or maybe I could, but I don’t know how or where to put this ‘Lock’.