[jboss-user] [Datasource Configuration] - "Cursor state not valid" while paging through table

Alexander Varakin do-not-reply at jboss.com
Sun Feb 12 01:06:46 EST 2012


Alexander Varakin [https://community.jboss.org/people/avarakin] created the discussion

""Cursor state not valid" while paging through table"

To view the discussion, visit: https://community.jboss.org/message/716036#716036

--------------------------------------------------------------
Hi,

I am having a problem with an application which runs under AS 7.0.2 (7.1.0CR1 as well). It connects to database on AS400 using JPA interface and  is able to read data from table on AS400 starting from row 0, but if I specify starting row more than 0 using query.setFirstResult, then I am getting an exception:

Caused by: java.sql.SQLException: Cursor state not valid.
    at com.ibm.as400.access.JDError.createSQLExceptionSubClass(JDError.java:819)
    at com.ibm.as400.access.JDError.throwSQLException(JDError.java:411)
    at com.ibm.as400.access.JDError.throwSQLException(JDError.java:387)
    at com.ibm.as400.access.AS400JDBCResultSet.beforePositioning(AS400JDBCResultSet.java:1282)
    at com.ibm.as400.access.AS400JDBCResultSet.absolute(AS400JDBCResultSet.java:1086)
    at org.jboss.jca.adapters.jdbc.WrappedResultSet.absolute(WrappedResultSet.java:131)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]
    at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]
    at org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:104) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]


Same code works fine under Tomcat 7 and Hybernate 3.6.9.
I guess this is related to scrollable result set, it seems that Hibernate does not make result set as scrollable. Is there any way to make result set scrollable?


Would appreciate any help....

Alex
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/716036#716036]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120212/98ccbd22/attachment-0001.html 


More information about the jboss-user mailing list