From: Joe Pluta
It's getting late and I must be getting confused, because AFAIK a
connection pool only returns a connection which matches the parameters
you are requesting. Those parameters typically include user ID,
password, and the connection URL, which in turn contains the connection
properties. The properties can be used to set up, for example, the
default schema. So in this case a connection would by definition only
return a connection for the correct tenant.

Thanks for that explanation. I just wanted to also explore the idea of writing
one's own connection pool manager rather than using one that might be built into
a web application server; where one of the parameters passed would be "tenant",
so that a tenant specific connection would be returned to the requester/servlet.
A library list may be defined at the time a connection is established, then
reused for subsequent requests, thereafter. Say you store tenant ID in a
session variable and use it to request a tenant specific connect from your pool
manager, thereafter. My next question is what scope should your connection pool
manager run under. Does that make sense?

The work on your part is to identify the correct connection
string for each tenant.

I understand how that could work for creating a new connection, but would it
work for requesting subsequent connections from the pool, where the pool manager
uses "tenant" to find an available connection?

The premise also cuts off some plausible alternatives. There absolutely
is no one-size-fits-all strategy.

That would be interesting to explore.

For example, persistent connections don't need any of this.
The connection sets its library list at the time it is created
and you use unqualified table names and system naming.


I thought *ALL connections in a pool were persistent; not necessarily persistent
for a specific user, but persistent nevertheless. My understanding is limited
about how connection pools are managed. I'm under the impression that in most
cases a connection is established for a server, but not necessarily for a
specific "tenant", or "user".

-Nathan





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.