3 Replies Latest reply on Sep 14, 2007 2:08 PM by vickyk

    Custom DataSourceBinding

      Currently we deploy all of our JBoss applications into distinct environments from Dev to Production. With in each environment we maintain an application that gives us the ability to secretly ask for the Oracle TNS information needed to connect to that environments Databases. Because of this I created a Service that will connect to the Database application and discover, based on the environment, the correct Oracle TNS entry to use.

      I have successfully fulfilled the Service requirements and have completed the JNDI Context entry for the EAR application. The problem I seem to have is that JBoss requires the developer to use a *-ds.xml file that creates the DataSource through the WrappedDataSourceService with in the jboss.jca:service=DataSourceBinding.

      My question is that is there anyway to dynamically configure the JBoss datasource other than using the *-ds.xml paradigm, and I am not talking about creating the xml on the fly?

        • 1. Re: Custom DataSourceBinding
          vickyk

           

          "chrisodom" wrote:

          My question is that is there anyway to dynamically configure the JBoss datasource other than using the *-ds.xml paradigm, and I am not talking about creating the xml on the fly?

          There is DeploymentServiceMBean which can help you to do so , all you need is to work and create velocity macros , but remember that it is experimental , I think it might work .
          Have a look at this link
          http://wiki.jboss.org/wiki/Wiki.jsp?page=DeploymentService
          Another option would be write a MBean which will create the ds.xml and deploy it , this is not too complex and you should be able to do it .
          Finally there is a JIRA for such requirement which would be done for Jboss5
          http://jira.jboss.com/jira/browse/JBAS-1425

          • 2. Re: Custom DataSourceBinding

            Using the DeploymentService seems to be working. What I did was to convert my Service Archive to interface with the DeploymentService and added in the undeploy and deploy methodology. This allows the admin the ability to change the Service Archive params on the fly to reconfigure the DataSource. The only problem with this is that I would have preferred to use the JBoss 5 implementation and when going to JBoss 5 this will have to be re-written. If you are going to follow this Topic I would definetly consider what the impact of this type of implementation will cause when migrating.

            • 3. Re: Custom DataSourceBinding
              vickyk

               

              "chrisodom" wrote:
              If you are going to follow this Topic I would definetly consider what the impact of this type of implementation will cause when migrating.

              If I am alive I am going to follow this Topic :)
              The DeploymentService is MBean which will surely work on the future release of Jboss