1 Reply Latest reply on Mar 20, 2002 5:47 AM by seven

    Cursor state not valid

    seven

      Hello.

      I am using JBoss-2.4.4 on a Slackware 8.0 with J2SE1.4.0 and I have a problem when I try to use scrollable result sets. The database I am using is a DB2 for AS/400, V4R5. The jt400.jar file (the jdbc driver) is from jtopen3.0

      The exception I receive when I try to go to a specified position in the ResultSet is this:

      [11:32:47,044,Default] Cursor state not valid.
      [11:32:47,047,Default] java.sql.SQLException: Cursor state not valid.
      [11:32:47,055,Default] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:360)
      [11:32:47,057,Default] at com.ibm.as400.access.AS400JDBCResultSet.beforePositioning(AS400JDBCResultSet.java:1160)
      [11:32:47,058,Default] at com.ibm.as400.access.AS400JDBCResultSet.absolute(AS400JDBCResultSet.java:973)
      [11:32:47,060,Default] at org.jboss.pool.jdbc.ResultSetInPool.absolute(Unknown Source)
      [11:32:47,061,Default] at ro.arena.ireg.ejb.ReporterBean.getAllNins(ReporterBean.java:44)
      [11:32:47,062,Default] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [11:32:47,064,Default] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [11:32:47,065,Default] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [11:32:47,066,Default] at java.lang.reflect.Method.invoke(Method.java:324)
      [11:32:47,067,Default] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
      [11:32:47,069,Default] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
      [11:32:47,070,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      [11:32:47,072,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:277)
      [11:32:47,073,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      [11:32:47,074,Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      [11:32:47,075,Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      [11:32:47,077,Default] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      [11:32:47,078,Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:410)
      [11:32:47,079,Default] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [11:32:47,080,Default] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [11:32:47,082,Default] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [11:32:47,083,Default] at java.lang.reflect.Method.invoke(Method.java:324)
      [11:32:47,084,Default] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [11:32:47,086,Default] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [11:32:47,087,Default] at java.security.AccessController.doPrivileged(Native Method)
      [11:32:47,088,Default] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [11:32:47,089,Default] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [11:32:47,091,Default] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [11:32:47,092,Default] at java.lang.Thread.run(Thread.java:536)

      The prepared statement instantiation is like this:
      conn.prepareStatement("query",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

      If I make the queries without scrolling, they work fine.

      If I use the same code in Tomcat-4.0.3 with a DataSource(probabily tomcat uses a tyrex datasource implementation) the scrollable result set works. If i use a simple client without datasource the scrollable result set works.

      So, is this a bug in the implementation of the XADataSource of the jboss? Is there any way I can use another XADataSource implementation (like tyrex)? Considering that the queries are read-only, can I use another kind of datasource (not XA)?


      Thanks in advance,
      seven

        • 1. It seems to be a bug though
          seven

          I checked the bug list at sf.net and I found out this:
          http://sourceforge.net/tracker/index.php?func=detail&aid=506549&group_id=22866&atid=376685. It seems that the PreparedStatement is not build properly in the XAClientConnection class.

          So I will try to use JBoss3.0.0beta to see if the bug is covered there, and if it doesn't work I will try to rebuild JBOSS-2.4.4 with the modified XAClientConnection.java

          And I will let u guys know, in case anybody will use this.

          Anyway, other questions stands: how can I use in JBoss-2.4.4 a different XADataSource implementation (tyrex or other) or not use XADataSource at all, but instead use a "plain" DataSource (a connection pool to be fair).

          Thanks,
          seven