hibernate/hibernate-orm · error · HibernateException
scroll(0) not valid
Error message
scroll(0) not valid
What it means
Argument validation in FetchingScrollableResultsImpl.scroll: scrolling by zero positions is not a meaningful operation; only positive (forward) or negative (backward) offsets are allowed.
Solutions
- Pass a non-zero row offset to scroll(); use absolute positioning or first()/next() instead of scroll(0).
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/internal/scrollable/FetchingScrollableResultsImpl.java:193 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/84e8c1d28787f40f.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/internal/scrollable/FetchingScrollableResultsImpl.java:193
// scroll ahead
for ( int i = 0; i < positions; i++ ) {
more = next();
if ( !more ) {
break;
}
}
}
else if ( positions < 0 ) {
// scroll backward
for ( int i = 0; i < -positions; i++ ) {
more = previous();
if ( !more ) {
break;
}
}
}
else {
throw new HibernateException( "scroll(0) not valid" );
}
afterScrollOperation();
return more;
}
@Override
public boolean position(int position) {
return setRowNumber( position );
}
@Override
public boolean last() {
boolean more = false;
if ( maxPosition != null ) {
if ( currentPosition > maxPosition ) {
more = previous();View on GitHub (pinned to fad1729dce)