[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-6076) query with setFirstResult throws Exception on derby
Strong Liu (JIRA)
noreply at atlassian.com
Wed Apr 6 14:06:59 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Strong Liu resolved HHH-6076.
-----------------------------
Assignee: Strong Liu
Resolution: Fixed
Fix Version/s: 4.0.0.Alpha2
> query with setFirstResult throws Exception on derby
> ---------------------------------------------------
>
> Key: HHH-6076
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6076
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 4.0.0.Alpha1
> Reporter: Strong Liu
> Assignee: Strong Liu
> Priority: Critical
> Fix For: 4.0.0.Alpha2
>
>
> when do a query with setFirstResult on derby, Exception like below be thrown
> {quote}
> [javatest.batch] ERROR: This method should only be called on ResultSet objects that are scrollable (type TYPE_SCROLL_INSENSITIVE).
> [javatest.batch] javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: This method should only be called on ResultSet objects that are scrollable (type TYPE_SCROLL_INSENSITIVE).
> {quote}
> by dig into the code, in
> {code:title=org.hibernate.loader.Loader#prepareQueryStatement}
> final boolean useScrollableResultSetToSkip = hasFirstRow &&
> !useOffset &&
> getFactory().getSettings().isScrollableResultSetsEnabled();
> final ScrollMode scrollMode =
> canScroll
> ? scroll || useScrollableResultSetToSkip
> ? queryParameters.getScrollMode()
> : ScrollMode.SCROLL_INSENSITIVE
> : null;
> {code}
> the "scroll" is false, and useScrollableResultSetToSkip is "true", so, the scroll model comes from queryParameters, which is null.
>
--
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