Getting java.lang.UnsupportedOperationException: query result offset is not supported in EAP7

Solution Verified - Updated -


  • java.lang.UnsupportedOperationException: query result offset is not supported is thrown when calling Hibernates's API org.hibernate.query.Query.getResultList(). What is the root cause of this exception?
18:40:08,258 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /hibernate5-sample/api/books: org.jboss.resteasy.spi.UnhandledException: java.lang.UnsupportedOperationException: query result offset is not supported
Caused by: java.lang.UnsupportedOperationException: query result offset is not supported
    at org.hibernate.dialect.pagination.TopLimitHandler.processSql(
    at org.hibernate.loader.Loader.executeQueryStatement(
    at org.hibernate.loader.Loader.executeQueryStatement(
    at org.hibernate.loader.Loader.doQuery(
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(
    at org.hibernate.loader.Loader.doList(
    at org.hibernate.loader.Loader.doList(
    at org.hibernate.loader.Loader.listIgnoreQueryCache(
    at org.hibernate.loader.Loader.list(
    at org.hibernate.loader.hql.QueryLoader.list(
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(
    at org.hibernate.internal.SessionImpl.list(
    at org.hibernate.query.internal.AbstractProducedQuery.doList(
    at org.hibernate.query.internal.AbstractProducedQuery.list(
    at org.hibernate.query.Query.getResultList(
    at$Proxy$_$$_WeldClientProxy.getBooks(Unknown Source)
  • Database is SQL Server 2019 with org.hibernate.dialect.SQLServerDialect for dialect .
  • The application code looks like the below:
public class BookResource {
    EntityManager em;

    public List<Book> getBooks(@QueryParam("start") int start, @QueryParam("limit") int limit) {
        Session session = em.unwrap(Session.class);
        String hql = "select b from Book b order by";
        Query query = session.createQuery(hql, Book.class);

        List<Book> books = query.getResultList();    // UnsupportedException from this line

                .map(b -> Book.of(b.getId(), b.getTitle(), b.getAuthor()))


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.3
  • Hibernate
  • SQL Server 2019

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content