[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5229) org.hibernate.test.hql.ScrollableCollectionFetchingTest.testScrollingJoinFetchesEmptyResultSet() fails on sybase

Gail Badner (JIRA) noreply at atlassian.com
Mon May 17 22:14:11 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37181#action_37181 ] 

Gail Badner commented on HHH-5229:
----------------------------------

To determine if a ResultSet is empty, FetchingScrollableResultsImpl.isResultSetEmpty() returns:

currentPosition == 0 && ! getResultSet().isBeforeFirst() && ! getResultSet().isAfterLast();

For Sybase ASE 15, when the ResultSet is empty, FetchingScrollableResultsImpl.isResultSetEmpty() returns true. I've verified that currentPosition is 0.

The problem is that Sybase JDBC returns true for ResultSet.isBeforeFirst() and/or ResultSet.isAfterLast() when the ResultSet is empty.

> org.hibernate.test.hql.ScrollableCollectionFetchingTest.testScrollingJoinFetchesEmptyResultSet() fails on sybase
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5229
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5229
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.1, 3.5.2
>            Reporter: Strong Liu
>            Assignee: Gail Badner
>             Fix For: 3.5.x, 3.6
>
>
> {quote}
> Result set is IDLE as you are not currently accessing a row.
> Description: The application has called one of the ResultSet.getXXX column-data retrieval methods, but there is no current row; the application has not called ResultSet.next(), or ResultSet.next() returned "false" to indicate that there is no data.
> Action: Check that rs.next() is set to "true" before calling rs.getXXX.
> {quote}
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> 	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
> 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
> 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
> 	at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:420)
> 	at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:83)
> 	at org.hibernate.test.hql.ScrollableCollectionFetchingTest.testScrollingJoinFetchesEmptyResultSet(ScrollableCollectionFetchingTest.java:67)
> Caused by: java.sql.SQLException: JZ0R1: Result set is IDLE as you are not currently accessing a row.
> 	at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source)
> 	at com.sybase.jdbc3.jdbc.SybResultSet.checkIfReadableRow(Unknown Source)
> 	at com.sybase.jdbc3.jdbc.SybResultSet.getColumn(Unknown Source)
> 	at com.sybase.jdbc3.jdbc.SybResultSet.getLong(Unknown Source)
> 	at com.sybase.jdbc3.jdbc.SybResultSet.getLong(Unknown Source)
> 	at org.hibernate.type.LongType.get(LongType.java:51)
> 	at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
> 	at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
> 	at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1120)
> 	at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:409)
> 	... 31 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list