9 Replies Latest reply on Mar 3, 2008 3:34 AM by Vicky Kak

    Oracle DS

    Davide Pettenò Newbie

      Hi,
      I would to know if i can put two different database configuration in the same datasource file.
      For example



      <local-tx-datasource>
      <jndi-name>BS_DB</jndi-name>
      <connection-url>jdbc:oracle:oci8:@xxxx</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>BS</user-name>
      BS
      <max-pool-size>100</max-pool-size>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>

      <local-tx-datasource>
      <jndi-name>AS_DB</jndi-name>
      <connection-url>jdbc:oracle:oci8:@xxxx</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>BBS</user-name>
      BBS
      <max-pool-size>100</max-pool-size>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>


      My jboss is 3.2.1 and Oracle 8i.

      Because sometimes i receive this error in starting mode:

      2008-02-20 03:41:06,849 ERROR [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting failed
      org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions. Message recovery may not be accurate; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused)))



      Thanks
      Davide

        • 1. Re: Oracle DS
          Vicky Kak Master

           

          "Artec" wrote:
          Hi,
          I would to know if i can put two different database configuration in the same datasource file.
          For example


          <datasources>
          <local-tx-datasource>
          <jndi-name>BS_DB</jndi-name>
          <connection-url>jdbc:oracle:oci8:@xxxx</connection-url>
          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
          <user-name>BS</user-name>
          <password>BS</password>
          <max-pool-size>100</max-pool-size>
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
          </local-tx-datasource>

          <local-tx-datasource>
          <jndi-name>AS_DB</jndi-name>
          <connection-url>jdbc:oracle:oci8:@xxxx</connection-url>
          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
          <user-name>BBS</user-name>
          <password>BBS</password>
          <max-pool-size>100</max-pool-size>
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
          </local-tx-datasource>
          </datasources>

          My jboss is 3.2.1 and Oracle 8i.


          Yes , you can do that .

          "Artec" wrote:

          Because sometimes i receive this error in starting mode:

          2008-02-20 03:41:06,849 ERROR [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting failed
          org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions. Message recovery may not be accurate; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused)))



          Thanks
          Davide

          Looks like you have broken connection this might happen due because of
          1) DB is down for some time .(DB restarts)
          http://wiki.jboss.org/wiki/Wiki.jsp?page=WhatHappensToJBossIfIRestartTheDatabase
          2) Internal DB issue .

          These broken connections can be resolved by configuring check-valid-connection-sql/exception-sorter-class-name in -ds.xml file
          Check this
          http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html



          • 2. Re: Oracle DS
            Davide Pettenò Newbie

            Hi vickyk, and thanks for your answer.
            Ok for the first question !
            For the second instead i attach you the part of the stacktrace above the error that i've past yesterday

            2008-02-29 00:00:36,823 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Starting
            2008-02-29 00:00:36,835 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.
            plugins.JaasSecurityManager@196bac4
            2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedC
            achePolicy@bfd10a
            2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added HsqlDbRealm, org.jboss.security.p
            lugins.SecurityDomainContext@1352367 to map
            2008-02-29 00:00:36,843 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.DefaultDS] Bound connectio
            n factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultD
            S'
            2008-02-29 00:00:36,843 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started
            2008-02-29 00:00:36,843 INFO [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting

            ...and so, the error is in the defaultds,right ?? and not in my oracle-ds ??
            I don't use hypersonic !

            Thanks
            Davide

            • 3. Re: Oracle DS
              Vicky Kak Newbie

               

              "Artec" wrote:
              Hi vickyk, and thanks for your answer.
              Ok for the first question !
              For the second instead i attach you the part of the stacktrace above the error that i've past yesterday

              2008-02-29 00:00:36,823 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Starting
              2008-02-29 00:00:36,835 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.
              plugins.JaasSecurityManager@196bac4
              2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedC
              achePolicy@bfd10a
              2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added HsqlDbRealm, org.jboss.security.p
              lugins.SecurityDomainContext@1352367 to map
              2008-02-29 00:00:36,843 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.DefaultDS] Bound connectio
              n factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultD
              S'
              2008-02-29 00:00:36,843 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started
              2008-02-29 00:00:36,843 INFO [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting

              ...and so, the error is in the defaultds,right ?? and not in my oracle-ds ??
              I don't use hypersonic !

              Thanks
              Davide

              Where is the error , these are just log statements ?


              • 4. Re: Oracle DS
                Davide Pettenò Newbie

                 

                "vicky.kak@jboss.com" wrote:
                "Artec" wrote:
                Hi vickyk, and thanks for your answer.
                Ok for the first question !
                For the second instead i attach you the part of the stacktrace above the error that i've past yesterday

                2008-02-29 00:00:36,823 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Starting
                2008-02-29 00:00:36,835 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.
                plugins.JaasSecurityManager@196bac4
                2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedC
                achePolicy@bfd10a
                2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added HsqlDbRealm, org.jboss.security.p
                lugins.SecurityDomainContext@1352367 to map
                2008-02-29 00:00:36,843 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.DefaultDS] Bound connectio
                n factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultD
                S'
                2008-02-29 00:00:36,843 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started
                2008-02-29 00:00:36,843 INFO [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting

                ...and so, the error is in the defaultds,right ?? and not in my oracle-ds ??
                I don't use hypersonic !

                Thanks
                Davide

                Where is the error , these are just log statements ?


                the complete stacktrace is

                2008-02-29 00:00:36,835 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.
                plugins.JaasSecurityManager@196bac4
                2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedC
                achePolicy@bfd10a
                2008-02-29 00:00:36,836 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added HsqlDbRealm, org.jboss.security.p
                lugins.SecurityDomainContext@1352367 to map
                2008-02-29 00:00:36,843 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.DefaultDS] Bound connectio
                n factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultD
                S'
                2008-02-29 00:00:36,843 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started
                2008-02-29 00:00:36,843 INFO [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting
                2008-02-29 00:00:42,942 ERROR [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting failed
                org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions. Message recovery may not be accurate; - nested thro
                wable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Connectio
                n is broken: Connection refused); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection
                ; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused)))
                at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(PersistenceManager.java:276)
                at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1299)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
                at $Proxy11.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:392)
                at org.jboss.system.ServiceController.start(ServiceController.java:408)
                at org.jboss.system.ServiceController.start(ServiceController.java:408)
                at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                at $Proxy5.start(Unknown Source)
                at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
                at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
                at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                at $Proxy7.deploy(Unknown Source)
                at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
                at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
                at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
                at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:273)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
                at $Proxy0.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:392)
                at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                at $Proxy5.start(Unknown Source)
                at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
                at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:597)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                at $Proxy6.deploy(Unknown Source)
                at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:365)
                at org.jboss.system.server.ServerImpl.start(ServerImpl.java:272)
                at org.jboss.Main.boot(Main.java:150)
                at org.jboss.Main$1.run(Main.java:388)
                at java.lang.Thread.run(Thread.java:536)
                Caused by: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Connec
                tion is broken: Connection refused); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connect
                ion; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused))
                at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
                at org.jboss.mq.pm.jdbc2.PersistenceManager.getConnection(PersistenceManager.java:1206)
                at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(PersistenceManager.java:219)
                ... 68 more
                Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException
                : Connection is broken: Connection refused)
                at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnection
                Factory.java:157)
                at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnection(InternalManagedConnectionPool.
                java:352)
                at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.jav
                a:151)
                at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.
                java:429)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:413)
                at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:331)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:488)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnecti
                onManager2.java:798)
                at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
                ... 70 more
                Caused by: java.sql.SQLException: Connection is broken: Connection refused
                at org.hsqldb.Trace.getError(Unknown Source)
                at org.hsqldb.Trace.error(Unknown Source)
                at org.hsqldb.jdbcConnection.reconnectHSQL(Unknown Source)
                at org.hsqldb.jdbcConnection.openHSQL(Unknown Source)
                at org.hsqldb.jdbcConnection.(Unknown Source)
                at org.hsqldb.jdbcDriver.connect(Unknown Source)
                at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnection
                Factory.java:147)
                ... 78 more

                • 5. Re: Oracle DS
                  Davide Pettenò Newbie

                  Hi vicky,
                  i've read something on google...if i don't use hypersonic, i must change my conf file ??
                  My conf directory is

                  standardjaws.xml
                  server.policy
                  login-config.xml
                  jndi.properties
                  jbossmq-state.xml
                  jboss-minimal.xml
                  jboss-service.xml
                  standardjbosscmp-jdbc.xml
                  log4j.xml
                  standardjboss.xml

                  I must change "DefaultDS" (in standardjbosscmp-jdbc.xml or onother file) to oracle-ds ???

                  Thanks a lot
                  Davide

                  • 6. Re: Oracle DS
                    Vicky Kak Newbie

                    Hey Davide,

                    "Artec" wrote:

                    at org.hsqldb.jdbcDriver.connect(Unknown Source)

                    This cleary indicates that there is some problem in HSQL , you can verify this by writing a simple jdbc application if you don't feel lazy :)

                    "Artec" wrote:

                    I must change "DefaultDS" (in standardjbosscmp-jdbc.xml or onother file) to oracle-ds ???

                    Thanks a lot
                    Davide

                    I think you should look at this , looks like you want to use oracle as the default datasource .
                    http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpMysqlAsDefaultDS
                    Also spend some time in reading this one
                    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050022#4050022


                    Vicky


                    • 7. Re: Oracle DS
                      Davide Pettenò Newbie

                       

                      "vicky.kak@jboss.com" wrote:
                      Hey Davide,

                      "Artec" wrote:

                      at org.hsqldb.jdbcDriver.connect(Unknown Source)

                      This cleary indicates that there is some problem in HSQL , you can verify this by writing a simple jdbc application if you don't feel lazy :)


                      I'm sorry but i'm just a system administrator !!! Have you an application (or a link) to verify the datasource.
                      Another question: but hypersonic is used by JBoss for what ??

                      "vicky.kak@jboss.com" wrote:

                      "Artec" wrote:

                      I must change "DefaultDS" (in standardjbosscmp-jdbc.xml or onother file) to oracle-ds ???

                      Thanks a lot
                      Davide

                      I think you should look at this , looks like you want to use oracle as the default datasource .
                      http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpMysqlAsDefaultDS
                      Also spend some time in reading this one
                      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050022#4050022


                      Vicky


                      • 8. Re: Oracle DS
                        Davide Pettenò Newbie

                         

                        "vicky.kak@jboss.com" wrote:

                        "Artec" wrote:

                        I must change "DefaultDS" (in standardjbosscmp-jdbc.xml or onother file) to oracle-ds ???

                        Thanks a lot
                        Davide

                        I think you should look at this , looks like you want to use oracle as the default datasource .
                        http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpMysqlAsDefaultDS
                        Also spend some time in reading this one
                        http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050022#4050022


                        D'u think is better (in production enviroment) to use only oracle ds ???

                        Thanks
                        Davide

                        Vicky


                        • 9. Re: Oracle DS
                          Vicky Kak Master

                           

                          "Artec" wrote:

                          I'm sorry but i'm just a system administrator !!! Have you an application (or a link) to verify the datasource.
                          Another question: but hypersonic is used by JBoss for what ??


                          What do you mean by verifying the datasource ?
                          If the ds is not deployed properly then the logs would indicate that , you will see the ERROR messages in the logs .
                          Hypersonic is there for experimental purpose , we never recommend it for the production .
                          Yes Oracle/MySql is good for production , I think MySql should be okay in production .
                          Finally consult your technical team to take such decisions and read the jboss wiki's , most of your questions will be answered .