question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

quarkus-reactive-mssql-client - Pagination throws Error

See original GitHub issue

Version

Quarkus - 2.7.2

Context

I am using pagination parameters, page Number and records per page to implement Pagination. For the same, below section of code is used. Integer pageNo = paginationDto.getPageNumber(); Integer recordsPerPage = paginationDto.getRecordsPerPage(); Page page = new Page(pageNo, recordsPerPage); query = query.page(page);

The query when executed, gives the error as attached herewith. Error Log.txt

Do you have a reproducer?

Have created the code inside the Quarkus Hibernate code base. PFA. hibernate-reactive-panache-quickstart.zip

Steps to reproduce

  1. Start server
  2. Run postman script -> AppUsers Pagination.postman_collection.json.zip
  3. See error log

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
git4rputuvalcommented, Jun 20, 2022

Yes, it’s a bug in Hibernate Reactive. I’m going to create an issue. As a workaround, it will work if the query has an order by clause (or a filter):

@git4rputuval For your example, it will work if you change BaseDataSvc#createCriteriaQuery to:

	protected PanacheQuery<CommonAppUsersMdl> createCriteriaQuery(CommonAppUsersQueryDto tQuery) {
		BaseQueryVO baseQueryVO = getQuery(tQuery);
		logger.info(baseQueryVO.getQuery());
		PanacheQuery<CommonAppUsersMdl> query = getRepository()
                                 // It doesn't matter the field, as long as there is a Sort.by
				.find( baseQueryVO.getQuery(), Sort.by( "loginname" ), baseQueryVO.getQueryMap());

		query = setPagination(query, tQuery);
		return query;
	}

Hi,

Have tested this with the “Sort” option. It is working. So we are going ahead with this solution till you resolve the issue.

Regards,

0reactions
git4rputuvalcommented, Jul 2, 2022

@git4rputuval It seems that Hibernate Reactive 1.1.7.Final (the one that contains the fix) will be backported to Quarkus 2.7. So, you might not have to upgrade up to Quarkus 2.10 to get it. See quarkusio/quarkus#26482 (comment)

Thanks. We will wait. For now, we have added the Order By and progressing with the client side deployment. But I will update once I receive the version 1.1.17.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pagination doesn't work with MSSQL for some query #1342
In Sql Server, we run different queries for pagination based on the type of query. ... The error happens for queries without an...
Read more >
Reactive SQL Clients - Quarkus
Reactive PostgreSQL Client extension​​ To create a Gradle project, add the --gradle or --gradle-kotlin-dsl option. For more information about how to install the...
Read more >
Quarkus Panache Orm on SQL Server: error on sorting and ...
sqlserver.jdbc.SQLServerException: Incorrect syntax near 'offset'.) Someone knows the reason? I cannot use the sort and the pagination together?
Read more >
Home of Quarkus Cheat-Sheet - GitHub Pages
A RESTEasy Reactive-based REST Client extension. You only need to replace the quarkus-rest-client to quarkus-rest-client-reactive . Multipart.
Read more >
Pagination/orderby with multiple tables' columns-postgresql
Which of the e-mail addresses is used for sorting the customers? The error message basically reflects that uncertainty. Come up with a clear...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found