I would create a stateless session bean. Have each bean that needs a
connection to a cache call that bean. Based on the login, and a mapping,
say stored in a RDBMS, have the stateless bean return a String which is the
JNDI name of the cache. Then have the working bean lookup that connection.
Now you simply add a new connection cache, update the mapping table with
what users get what databases and viola, you're done.
Dave Wolf
Internet Applications Division
Sybase
----- Original Message -----
From: "B. Flaumenhaft" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 27, 2000 5:02 PM
Subject: Multiple connection pools dynamically?
> Folks,
>
> I'm struggling with a connection pooling problem.
>
> I have a single host server (or server cluster) that's servicing
> multiple accounts (or instances of the website). Depending on who has
> logged in, I need their beans to access different databases.
>
> For example, if a customer logs in for site A, their OrderHistory
> beans would need to access database A. If a customer logs in for site
> B, their OrderHistory beans would need to access database B.
> Databases A and B might be the same database server or a different
> one, but they need to use different JDBC connect strings.
>
> So far, it's not too tricky; I just register the beans as using both
> connection pools (datasources for A and B).
> How do I dynamically add a new site, though? It's not as simple as
> adding a new data source; I also need to register each bean to use
> that new data source. So if I have several hundred web sites and
> several hundred data sources, I'd need each of several dozen beans to
> use each database. This is a bit of an administration headache, right?
>
> Thoughts? The reason behind this is that I'm trying to have one host
> machine service multiple accounts, kind of an ASP model. If someone
> signs up for our service, I don't want to have to edit a bazillion
> configuration files to add one new schema or instance of the database.
>
> All help is appreciated. I've looked around for this, and I can't
> find anyone who's trying something similar.
>
> Thanks,
> Ben
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".