1 Reply Latest reply on Feb 24, 2004 9:43 AM by nlmarco

    Change configuration runtime

    nlmarco

      Hello *,

      I'm using jboss 3.2.2 together with jpox (a jdo implementation).

      Because one server is managing multiple datasources dynamically, I need to be able to change the configuration runtime. It should work like that:

      1) User clicks a button.
      2) My EJB creates a new database...
      3) ...and deploys a jdo PersistenceManagerFactory for this database.

      My problem lies in point 3: I have to update the file ${jboss}/server/default/deploy/jpox-ds.xml, but this brings the following problems:

      * I've read that you should never use java.io.* within an EJB. How can I access this file if I can't use java.io.*? I mean, of course, I would use sth. like Xerces to edit the file, but I guess, this uses java.io.* itself...
      * How can I know where this file is? Is there a way to ask jboss where its deploy directory lies? Or is there another way to open and change the file?

      Thanks a lot for your help in advance!!!

      Best regards, Marco :-)

      P.S.: The European council agitates for unlimited software patents what is a big danger for open source projects as well as SMEs in Europe:
      http://www.heise.de/english/newsticker/news/44931
      http://www.ffii.org/ffii-cgi/aktiv?f=euparl&l=en
      http://petition.eurolinux.org/index.en.html

        • 1. Dukes Bank jboss-build.xml anyone psot a version using Oracl
          nlmarco

          I am trying to connect my JBoss application to Oracle to use so that Dukes Bank is uses an Oracle Database instead of HyperStream I have tried to follow the tutorial in the Dukes Bank example using OracleXA:


          These are the steps I have carried out so far:

          1) I have modified the oracle-ds and deployed it to : C:\jboss-3.2.5\server\default\deploy


          <local-tx-datasource>
          <jndi-name>OracleDS</jndi-name>
          <connection-url>jdbc:oracle:thin:@localhost:1521:BankDB</connection-url>
          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
          <user-name>system</user-name>
          manager
          <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
          <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
          <!-- Checks the Oracle error codes and messages for fatal errors -->
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
          <!-- sql to call when connection is created
          <new-connection-sql>some arbitrary sql</new-connection-sql>
          -->

          <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
          <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
          -->

          </local-tx-datasource>





          2)) Modified C:\jboss-3.2.5\server\default\conf\jboss-service.xml

          <!-- The configurable Xid factory. For use with Oracle, set pad to true -->

          true


          3) Copied classes12.jar to C:\jboss-3.2.5\server\default\lib

          4) Copied oracle-xa-ds to C:\jboss-3.2.5\server\default\deploy


          <xa-datasource>
          <jndi-name>XAOracleDS</jndi-name>
          <track-connection-by-tx/>
          <isSameRM-override-value>false</isSameRM-override-value>
          <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
          <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:BankDB</xa-datasource-property>
          <xa-datasource-property name="User">system</xa-datasource-property>
          <xa-datasource-property name="Password">manager</xa-datasource-property>
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
          <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
          <no-tx-separate-pools/>
          </xa-datasource>


          <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager




          **********************************************************************************************
          But I am not sure what to do next as regards the jboss-build.xml file:

          It makes references to the HyperSonic Build Tool, since I want to use Oracle I should delete all references to hsqldb in the jboss-build.xml, but not to sure what I should add to make sure that Dukes Bank points at Oracle.

          Thanks for any help.