[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6076) query with setFirstResult throws Exception on derby
Strong Liu (JIRA)
noreply at atlassian.com
Sun Apr 3 10:42:08 EDT 2011
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
Priority: Critical
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