Yes, I’m motivated by observing Lars to write inline comment… check below… Sorry for the many links!
Theres kind of an assumption here that this must be a single user scenario. You wouldn’t want to be swapping databases with 3 users logged in!
Yeah… that would be stupid… but I guess with the thread-safe proxies inside Spring AOP, it would let you complete you current transactions for loggin user and after that has finished it will ask the user to login again because his session isnt in the factory. How it would really work, is just a guess that I need to try out.
And when the user logs in again he doesnt find his previous data… thats going to scare the user!! But its an implementation issue I guess!! 
This second way would probably have to go along the lines of what I think Saptarshi is saying ie. remove the link between authentication and the webapp. The service modules are “natively” secured . The web layer becomes just like a GUI toolkit which you don’t require authentication to use.
yes, kind of like that but even the web interface has to access the API. Yes, the GUI independently won’t need any authentication to use, because the services would be authenticated.
···
2010/1/28 Bob Jolliffe bobjolliffe@gmail.com
2010/1/28 Lars Helge Øverland larshelge@gmail.com
OK… can you explain a bit more how you think this will provide ability to switch/connect to databases during runtime…?
Hmmm… explaining AOP seems like a humongous task and I was surprised when I first looked at DHIS2 that we have only used BI from Spring and virtually nothing else. The example here or better explained here, looks like what I was saying. I was also reminded that I have once earlier tried this, but the AOP solution was neater.
Regards,
Saptarshi PURKAYASTHA
Director R & D, HISP India
Health Information Systems Programme
My Tech Blog: http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE