R – Subsonic: dynamic connections

netsubsonicwinforms

I have an ancient mess I'm trying to shovel into tiers using subsonic. Trouble is, I have this scenario:

When Hal logs in, his login uses database X for lookup data, database Y for his accounts and database Z for his contacts.

When Barry logs in, his login uses database X for lookupdata, database Q for his accounts and database R for his contacts.

X,Y,Z,Q and R are all on the same server. Y has an indentical schema to Q, and and Z has an identical schema to R. Don't get me started on how stupid a setup this is 🙂

I have to make my .NET Winforms App (using subsonic) point to the correct databases.

As far as I can tell, I'll have to get my hands dirty changing the SubSonic source (and maintain those changes with every subsonic release), so it can accept parameters rather than use app.config. Can anyone see an alternative to this?

Best Answer

I've have never considered 'SharedDbConnectionScope' easy or suitable for my applications

Yet that's is the answer isn't it? It's why we put it in there - and yes I've heard your requests for connection changing on the fly and I've built it in, as I keep telling you in every thread that we have.

Changing the connections on the fly is a request we've had a for a long, long time and we added it in there a long while back - and as far as I know it works like a charm.

For SubSonic 3 I'm plugging in about 10 different ways that you can change your DBs connection whenever you want, to whatever platform you want with whatever object set you want.