hibernate/hibernate-orm · error · UnsupportedOperationException

Empty result set

Error message

Empty result set

What it means

Sentinel UnsupportedOperationException from EmptyScrollableResults.get: this scrollable represents an empty result set and holds no row to return, so any attempt to read the current row is unsupported.

Solutions

  1. Check isBeforeFirst()/hasNext() before reading rows; the result set is empty.
  2. Handle the empty case (return empty list / Optional.empty) instead of scrolling.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/internal/scrollable/EmptyScrollableResults.java:99 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/b08839fa3d1ff451. Report an issue: GitHub.

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/internal/scrollable/EmptyScrollableResults.java:99

		return -1;
	}

	@Override
	public int getPosition() {
		return 0;
	}

	@Override
	public boolean setRowNumber(int rowNumber) {
		return false;
	}

	@Override
	public void setFetchSize(int fetchSize) {}

	@Override
	public R get() {
		throw new UnsupportedOperationException( "Empty result set" );
	}
}

View on GitHub (pinned to fad1729dce)