Re: One App, db connection onload, depending on WebAdress
Re: One App, db connection onload, depending on WebAdress
- Subject: Re: One App, db connection onload, depending on WebAdress
- From: "Jerry W. Walker" <email@hidden>
- Date: Sun, 7 Mar 2004 14:35:49 -0500
Ute,
There might be some wierd way to do what you're trying to do in a
single app instance, but doing so would be an exercise in virtuosity
and would tend to fight the architecture of WO rather than work with it.
I'm presuming that you have a single set of models that map to any of
several identically or similarly configured databases with different
data. If that's the case, a given attribute of a given EO would be tied
to the first database to which it was connected. Trying to attach it to
a second database while the first was still connected would raise an
exception.
I think you would be better served by running multiple instances of the
same app, each instance accessible at a different URL as configured in
JavaMonitor (or some substitute for it). Each instance would test the
source URL upon starting up and load its own model and corresponding DB
in its Application object at that point. The application would need to
make no further checks, because it could only be reached through the
URL from which it started up. You would then have no conflict between
models and databases at the EOModelGroup level, you would only have to
write the application once and you would not have to keep testing the
URL to determine from which database to extract the data.
Good luck,
Jerry
On Friday, March 5, 2004, at 04:14 AM, Ute Hoffmann wrote:
Hallo,
I'm thinking of connecting from different virtual host addresses to
the same app but using a different DB for each address. The app would
need to know which Adress it was talking to and connect to the right
database depending on the current Adress.
The Modelfiles of this App are in a framework and the App sets the url
for the modelfiles in the Application Class onload, each App for its
specific DB at the moment.
I think I know that I can check the URL and find out from which
virtual host it is coming. I probably could then add a conditional
loading the right database URL, but I would probably not be able to do
this in the Applikation Class? Would the Session be the right place
for this and if yes, am I right that each session would have its own
DB Connection, which would not be what I want to have.
Is there a way to set the db connections in the Application Class and
just switch between databases depending on which Webadress the user
comes from, but having only one connection for each DB. If yes, would
it also work with ConcurrentRequestHandling enabled?
I hope I got this clear. Any hints you can give me on this?
Regards,
Ute
_______________________________________________
--
__ Jerry W. Walker
c o d e f a b - "High Performance Industrial Strength Internet
Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.