Am 09.02.2011 12:12, schrieb chris derham:
  That's right, my code doesn't support a variable amount of databases at
the moment because
the databases are configured in Spring (inside my war file).
But if I use the context to configure this list of datasources, the admin
can create databases as he need.
And that's the reason why my configuration has to take place in the server
context and not hardcoded in the Spring configuration.
In Spring I can add more databases as I want, but I have to rebuild my war
file after change the datasource.
With a context configuration my war file can handle as many databases as
the admin configures.
The switch is done by the key of the map.

So why don't you have a string resource in the context that provides the
jndi names of all the jndi data sources, e.g.
mydatasourceJndiNames=name1,name2,name3. Then have some code the lazily
loads this string, splits it, and then loads these via jndi into your map?

Chris

That's the thing I work on at the moment.
But I thought it could be defined by a map in context.xml like in Spring.

Stephan

--
*Stephan Beutel (B.Eng.)*
Senior Software Developer

Axivion GmbH
Nobelstr. 15
70569 Stuttgart
Germany

Tel: +49 711 6204378-66
Fax: +49 711 6204378-99

Mail: beu...@axivion.com <mailto:beu...@axivion.com>
URL: http://www.axivion.com

Geschaeftsfuehrung: Stefan Bellon, Thomas Eisenbarth, Sebastian Rummler
Sitz der Gesellschaft: Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 720590

Reply via email to