3 Replies Latest reply on Sep 26, 2013 11:11 AM by Fab

    DefaultDS - Replacing HSQL with Oracle

    Scott Snowden Newbie

      I have installed Jboss successfully and trying to replace the HSQL DefaultDS with Oracle.

      1. Renamed JNDI name on hsqldb-ds.xml
      2. Copied oracle-ds from examples/jca and supplied neessary parameters.
      3. And named the oracle JNDI datasource name as DefaultDS.


      When I start the server, it comes up without anyissues. My questions are:

      (a) Should I see any tables on database created by JBOSS ?

      (b) What's a simple test that I can do to make sure that JBOSS is indeed using new data source and works fine.

      Thanks
      CM

        • 1. Re: DefaultDS - Replacing HSQL with Oracle
          Peter Johnson Master

          Which version of JBoss AS?

          The changes you made are incomplete - you might also have to change the Quartz and Messaging configurations. The exact steps depend on the version.

          • 2. Re: DefaultDS - Replacing HSQL with Oracle
            BIJAYA PRADHAN Newbie

            Hi, Please refer chapter 14 in installation and getting started guide for Jboss 4.2.2/5.0. ( from jboss.org)

            If you retain 'DefaultDS' name for oracle, ( you may prefer it as it does not require changing configuration of those services using database using DefaultDS)

            For this you may have to remove hsql ds xml from deploy dir..and put oracle-ds-xml..

            a) Yes, you will see many tables created by Jboss in your databse as 'DefaultDS' is used as data source in other Jboss servicess such as messaging, JAAS, etc...

            b) You may create a simple database client test app as follows.. create a test.jsp with following contents..

            <%@page contentType="text/html"
            import="java.util.*,javax.naming.*,javax.sql.DataSource,java.sql.*"
            %>
            <%
            DataSource ds = null;
            Connection con = null;
            PreparedStatement pr = null;
            InitialContext ic;
            try {
            ic = new InitialContext();
            ds = (DataSource)ic.lookup( "java:/DefaultDS" );
            con = ds.getConnection();
            pr = con.prepareStatement("SELECT col1, col2 FROM <your table name in oracle DB>"); // any test sql, or its variant
            ResultSet rs = pr.executeQuery();
            while (rs.next()) {
            out.println("<br> " +rs.getString("col1") + " | " +rs.getString("col2"));
            }
            rs.close();
            pr.close();
            }catch(Exception e){
            out.println("Exception thrown " +e);
            }finally{
            if(con != null){
            con.close();
            }
            } %>
            
            


            create a directory test.war in $JBOSS_HOME\server\{your svr confg such as default}\deploy\
            Put this test.jsp under test.war

            test the jsp at http://localhost:8080/test/test.jsp

            hope this helps..

            Cheers,
            bpradhan

            • 3. Re: DefaultDS - Replacing HSQL with Oracle
              Fab Newbie

              Hello.

               

              Coming back to this old post while doing the migration HSQL -> Oracle on JBoss 5.0.0 GA.

              Followed the steps, everything is fine.

              Tested on Dev environnment, no problem.

               

              But as soon as moved to production environnment, JBoss runs out of memory after 10 minutes, everytime it is launched into the configuration having Oracle as DefaultDS.

               

              Followed the steps: deploy/oracle-ds.xml, depoy/messaging/oracle-persistence-ds.xml, conf/login-config.xml, and the ejb3-timer-service.xml has been reviewed.

              Tables are created in the Oracle DB, everyhting looks just fine, EJBs and JMS are working perfectly.

               

              Just this out of memory after 10 minutes...

              Any experience on that ?

              Any idea?

              Getting crazy as I would expect JBoss to use less memory as HSQL is not started anymore...

               

              Thanks for any suggestion.

              All the best

              Fabrice