5 Replies Latest reply on Aug 8, 2002 12:59 AM by bbbear

    XA or not XA data source

    claude

      I'm using JBoss 2.4.4 and I have the following problems with the JDBC connection pool:

      When I use the XA connection pool (org.jboss.jdbc.XADataSourceLoader), dataSource.getConnection() sometimes throws a NullPointerException, when the load reaches a certain level.

      Then, I thought there was a bug in the XA datasource and I decided to use a non-XA datasource (org.jboss.jdbc.JDBCDataSourceLoader). I think I can do that, because all my data is persisted in only one data store; am I right?
      With the non-XA datasource, everythink works very well with CMP entity beans (I don't get the NullPointerException any longer). However, when a session bean performs a JDBC access to the database, I get a java.sql.SQLException with error ORA 01002 (Oracle error: FETCH out of sequence). Note that it occurs only when I read data with "SELECT ... FOR UPDATE".

      Does anyone can help? either to solve the problem with the XA data source or with the non XA datasource?

      Thanks a lot
      Claude

        • 1. Re: XA or not XA data source
          davidjencks

          Use the XADataSourceLoader and set blocking=true. I recommend a blocking timeout also. The JDBC.... leaves its connections with autocommit on, which means you have no tx control and statements that don't make sense by themselves (like select ... for update) won't work.

          • 2. Re: XA or not XA data source
            bbbear

            Hi David,

            I have the same problem with configuring datasource with JBoss 2.4.4_Tomcat4.0.1. I tried to do what you've suggested, set blocking=true. However, JBoss server hangs at here:
            [INFO,MSSQLPool] Starting
            [INFO,MSSQLPool] XA Connection pool MSSQLPool bound to java:/MSSQLPool

            I wonder what has gone wrong. Previously, when I have not set blocking=true, it throws me a NullPointerException and I've tried to search through the forum, have yet find any solutions. Basically I'm trying to configure MS SQL 7 datasource, which resides on another machine (Windows platform), with JBoss2.4.4_Tomcat4.0.1 under Linux platform (RedHat 7.2). I changed all the things that I've found from the forum but it still throws NullPointerException and until now it hangs there. Therefore, I'm hoping someone where I can consult with to have a look at my jboss.jcml's JDBC config portion. Please tell me where have I missed. Would really appreciate if there's anyone who can help, thank you!

            p/s: Below is previous's testing result when I have not set blocking=true

            Regards,
            Karen

            ###### JBoss output ########
            ...
            [INFO,JdbcProvider] Initializing
            [INFO,JdbcProvider] Loaded JDBC-driver:com.microsoft.jdbc.sqlserver.SQLServerDriver
            [INFO,JdbcProvider] Loaded JDBC-driver:org.postgresql.Driver
            [INFO,JdbcProvider] Initialized
            [INFO,MSSQLPool] Initializing
            [INFO,MSSQLPool] Initialized
            [INFO,PostgreSQLPool] Initializing
            [INFO,PostgreSQLPool] Initialized
            ...
            ...
            ...
            [INFO,JdbcProvider] Starting
            [INFO,JdbcProvider] Started
            [INFO,MSSQLPool] Starting
            [INFO,MSSQLPool] XA Connection pool MSSQLPool bound to java:/MSSQLPool
            [ERROR,MSSQLPool] Stopped
            java.lang.NullPointerException
            at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source)
            at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:412)
            at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
            at $Proxy0.start(Unknown Source)
            at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.Main.(Main.java:208)
            at org.jboss.Main$1.run(Main.java:110)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.jboss.Main.main(Main.java:106)
            [ERROR,ConfigurationService] Unexpected error
            java.lang.NullPointerException
            at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source)
            at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:412)
            at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
            at $Proxy0.start(Unknown Source)
            at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.Main.(Main.java:208)
            at org.jboss.Main$1.run(Main.java:110)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.jboss.Main.main(Main.java:106)
            [INFO,PostgreSQLPool] Starting
            [INFO,PostgreSQLPool] XA Connection pool PostgreSQLPool bound to java:/PostgreSQLPool
            [INFO,PostgreSQLPool] Started

            ####### jboss.jcml #######



            com.microsoft.jdbc.sqlserver.SQLServerDriver,
            org.postgresql.Driver




            MSSQLPool
            org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

            jdbc:microsoft:sqlserver://PA2300:1433;DatabaseName=MASTERDB;SelectMethod=cursor
            1200000
            sa
            100
            sa
            false
            false
            true
            false
            120000
            1800000
            true
            false
            1.0
            0

            • 3. Re: XA or not XA data source
              tkimu

              Hi Karen

              Even I have the same problem, did u figureout the problem, If u resolved this, can I know the satus


              Thanks
              Krishna

              • 4. Re: XA or not XA data source
                davidjencks

                In 2.4, hanging with blocking == true or returning null with blocking == false means your datasource configuration is wrong and the driver can't get a connection to the datasource.

                • 5. Re: XA or not XA data source
                  bbbear

                  Hi Krishna,

                  I've finally got it through by replacing the domain name of the URL to IP address. If you've noticed my configuration of the datasource, I put PA2300 at the URL, which won't work in my case but to replace it with IP address, it now works.

                  HTH

                  p/s: Thanks David for pointing where should I look into. It's indeed the datasource configuration's problem.

                  Regards,
                  Karen