RE: AW: AW: Multiple Databases within the same application

"Shash Chatterjee" <[email protected]>
Newsgroups gmane.comp.java.keel.user
Message-ID <[email protected]>
Tim,

The login domain and the db domain were tied together, until very recently. 
When you logged in, the domain picked from the list you get on the login
screen if you have multiple domains, is stored in the context and available
via the request.  If you don't have domains, the value in there is "default".  

So, if you login to the "default" domain, and you want to use your "default"
DB (which is the case for the vast majority of installations), then
req.getDomain() will still work.

Otherwise, you can a) hard-code the different db domain you want, b) make the
 DB domains be determined via configuration c) use the domain lookup service
just put in (extended/configured as appropriate). 

Shash

> Shash,
> 
> Does that mean that when we have multiple connections we can no 
> longer use: 
> 
> PersistentFactory pf = (PersistentFactory) request.getService
> (PersistentFactory.ROLE,request.getDomain()); 
> 
> and we must use:
> 
> PersistentFactory pf = (PersistentFactory) request.getService
> (PersistentFactory.ROLE,id-of-default-persistent);
> 
> Thanks,
> Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.