I would like to know if it is possible to alter the datasource during
a request based on the request object and then allow Persevere to
continue on with its normal processing. This goes back to my
questions about running multiple Persevere apps (
http://groups.google.com/group/persevere-framework/browse_thread/thread/c1f61517979f4982/bc4ba5a2c9eed000?hl=en#bc4ba5a2c9eed000
), but when I think of database engines like MySQL or MS SQL Server, a
single instance of the database can handle requests from multiple
webapps for different catalogs. I would like a single Persevere
application (the distinction between the application and database is
blurred) to be able to connect to any datasource on the fly based on
application logic (inspecting the request or session object), and then
pass the request to the normal Persevere app process for handling.
Callback hooks into different parts of the request lifecycle plus the
ability to manipulate the datasource (or whatever) would be ideal.
I know that there already exists a facility for JSGI HTTP Request
Handling using app and coreApp, but I am not sure how to go about what
I'm after or if it's possible. I've found that running multiple
duplicate Persevere apps is not the answer due to unnecessary resource
consumption. This is fairly straight forward in regular servlets/
PHP/.NET (take your pick), so I'm thinking this shouldn't be difficult.