1 Reply Latest reply on Jan 24, 2010 11:24 AM by alessandro rossi

    How to connect one app to different instances dynamically

    Larry Strezo Newbie

      We have 5 database instances. They have the same schemas but different development projects connecting to them. They use our application to talk to those instances. Is there a way to dynamically (parameter?) to dynamically connect to another instance or is Seam locked into one instance per build.
      We currently have a different ear file for each database - but they don't play well together. So now we have been forced to have several instances of Jboss running on the same machine.


      Any help would be greatly appreciated.


      Thanks in advance Larry

        • 1. Re: How to connect one app to different instances dynamically
          alessandro rossi Newbie

          I don't known if is it possible or not, if there are present security reason (isolation) or not, but i think could be don't much difficut obtain what you want (integrate all your projects) on one big projects if you follow some conventions.
          For the moment i don't development using seam (before i have some questions) but when i see some example as jboss-seam-jpa on seam i see that even using different projects:
          the web.xml remain the same;
          the faces-config.xml remain the same;
          the components.xml i don't known if remain the same of your must doing some changes;
          on the pages.xml should be sufficient put each projects on a sub-directory;
          on each projects, if they use different template,should be necessary rename the template so change even the name of the template on each xhtml involved;
          add a layer where you make a choice of the project that you want use or eventually, if the access on each projects use a different login/password, the user don't should choice anything.
          Sure there are some code to add on the projects but i don't think is too much.


          Furthermore, as a secondary effect of these changes, if you should sell only some projects (despite i don't think is your case), will be sufficient only some change on the configurations and remove the project unnecessary without touch the code, for develop a custom war for some clients).


          However please remember that i don't known well Seam, but given the


          levels of decoupling


          present using these type of frameworks, theoretically these changes should not be too traumatic.



          Some general discussion about multiple repositories sharing a single JPA:
          Multiple repositories sharing a single JPA Source