Hi Kjell, There is nothing to stop you specifying multiple <resource-ref> tags, so the bean can reference multiple databases.
I'm not a cmp expert (far from it) but can't you deploy the application four times, under different jndi-names for the application beans and databases? The client code or servlet/jsp code then just has the job of working out which names to use in lookup(). Or you could put a "facade" in front of the application to do the mapping based on the principal, although I don't know how you would stop requests trying to bypass it - doesn't mean it can't be done:-) A bit of security should stop user's from one division accidentally or maliciously accessing other divisions. I assume you can't just add "division" to each database record as part of the key because you have other tools to report on the database? There's probably other ways to do this. Completely wild idea with no thought. It might even be possible to use a custom pool that retrieves database dependent beans based on the principal/division, but there's probably good reasons why it wouldn't work :-) Regards, Adrian >From: Kjell Nilsen <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: SV: [JBoss-user] Several instances of JBoss >Date: Fri, 18 Jan 2002 15:15:15 +0100 > >Thanks, > >i'm shure we will have goods use of your advise if we need to set up this >configuration. > >We cant't use the solution with multiple database connections in >jboss.jcml >because then same bean will nead to reach different databases ( to keep >data >from different divisions / departmentes in different databases.) > >Regards, Kjell. > >-----Opprinnelig melding----- >Fra: Adrian Brock [mailto:[EMAIL PROTECTED]] >Sendt: 18. januar 2002 11:55 >Til: [EMAIL PROTECTED] >Emne: Re: [JBoss-user] Several instances of JBoss > > >Before I answer your direct question: >If all you want to do is run different beans over different >databases you can do this by setting up multiple database >connections in jboss.jcml and then specify the one you want >in j2ee-jar.xml/jboss.xml using <resource-ref> and <resource-manager> >tags. > >Now to answer your direct question: >You can do this through multi-homing. >I've never done this myself, but I've seen people on this list who >have. >This works by assigning your interface/adaptor multiple ip >addresses and then in the host table you map the ip addresses >to different host names. >To make this work with rmi you need to add the property >-Djava.rmi.server.hostname to run.bat/run.sh >this makes rmi use the host names to distinguish which >instance of jboss you want to use. > >Clustering is nearly the opposite. This runs JBoss on multiple machines >as though they were the same instance. > >Regards, >Adrian > > >From: Kjell Nilsen <[EMAIL PROTECTED]> > >To: "'[EMAIL PROTECTED]'" > ><[EMAIL PROTECTED]> > >Subject: [JBoss-user] Several instances of JBoss > >Date: Fri, 18 Jan 2002 10:07:18 +0100 > > > >Is it possible to run serveral instances of JBoss of JBoss in the same > >server? I know clustering is only still in alpha, but can we serveral ( >eg > >4) independant instances running using the current JBoss verson. ( The > >point is to have each one run against a separate SQLServer instance.) > > > >I expect we will need a"hot" server with lots of memory - have anyone >tried > >somthing like this ? > > > >Tia, Kjell. > > > > > > > >_______________________________________________ > >JBoss-user mailing list > >[EMAIL PROTECTED] > >https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > >_________________________________________________________________ >MSN Photos is the easiest way to share and print your photos: >http://photos.msn.com/support/worldwide.aspx > _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
