Re: default domain by app
"Shash Chatterjee" <[email protected]>
| Newsgroups | gmane.comp.java.keel.user |
|---|---|
| Message-ID | <[email protected]> |
> I've set up keel's tables for authentication in a db: keel. My
> application data is stored in its own db: mydb. I want to use the
> applications that have already been developed by the community that use
> those tables, but I don't want to combine the databases into one.
> I'd like my application to be configured to look at a default db, preferably
> through configuration, without having to hard code a domain into all
> models. After writing this I see that I can configure a dbpool
> (don't know how exactly, docs scarce their also), and a simple
> search and replace on my application could get that code implemented,
> so I may now just need to figure out the svc-domain-config.
>
You don't need domains at all for this. Simply setting up another dbpool is
sufficient. What you need is to override the configure() method (if you
extend StandardLogEnabledModel, otherwise implement the Configurable
interface), and add a configuration parameter for your model to take the name
of a dbpool. Then when you get your PersistentFactory, do it with the name of
your dbpool:
String myDB = null; //Set in configure() method
....
PersistentFactory myFac =
(PersistentFactory)request.getService(PersistentFactory.ROLE, myDB);
> I've followed Shash's posts on setting up multiple jdbc elements, my
> one question now is exactly where do i put that (which file)?
>
Just put it in *any* file in the conf/server/ directory of your app with a
name like <something>-system.xconf, and it'lll get picked up and merged.
> NOTE: I noticed in anon CVS that keel-server/sample-conf and all subdirs
> are empty. Is that correct?
That's correct....got moved to service-persist-base/sample-conf