switchServer() documentation

Questions, tips and tricks and techniques for scripting in Servoy

switchServer() documentation

Postby gianni1334131930 » Wed Apr 11, 2012 10:28 am

We are using switchServer() to manage multitenant application. The application is by default connecting to a test/demo environment while using specific users is switching standard connections to the production environment using switchServer() technique. Users in this context are not Servoy managed users but application managed users.

Example: LogicalServerName > DatasourceName
Default connection at startup (demo/test company):
- kernel_data > kernel_data
- kernel_azi_data > kernel_azi_data
- firm_data > firm_data
- firm_pricing_data > firm_pricing_data
After moving with switchServer() to myComp company:
- kernel_data > kernel_data
- kernel_azi_data > myComp_firm_data
- firm_data > myComp_firm_data
- firm_pricing_data > myComp_firm_pricing_data

It is not fully clear from documentation what is automatically switching and what is not; in other words: in the standard Servoy environment which function calls/structures are aware of server switching? Which of them refers to a logical servername and which refers to a physical servername aka a datasource name?
- forms datasource
- valuelists "table values" or "related values"
- databaseManager
- plugins.rawSQL
- plugins.maintenance
- ...others...

Tnks to anyone will help to clearify what we currently see as a problem...

Gianni
gianni1334131930
 
Posts: 3
Joined: Wed Apr 11, 2012 10:12 am

Re: switchServer() documentation

Postby ngervasi » Wed Apr 11, 2012 12:35 pm

Everything except rawSQL is switched, I'm not sure about the maintenance plugin because I haven't had a chance to use it yet.
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy


Return to Methods

Who is online

Users browsing this forum: No registered users and 1 guest