Giter Club home page Giter Club logo

Comments (8)

pshingavi avatar pshingavi commented on June 4, 2024 1

@darrachequesne Yes, I got this working with the v3.0 version. Thanks a ton for the fix !

from spring-data-jpa-datatables.

svnsiva avatar svnsiva commented on June 4, 2024 1

@pshingavi @darrachequesne I am facing the same problem. Can any of you provide the solution. I couldn't find anything in the GitHub link available above.

from spring-data-jpa-datatables.

pshingavi avatar pshingavi commented on June 4, 2024

This is similar to the problem here : http://stackoverflow.com/questions/26901010/spring-data-jpa-eager-fetch-with-join-and-using-pagination-not-working

I see the below WARNING in my logs :

Log message is WARN org.hibernate.hql.internal.ast.QueryTranslatorImpl - HHH000104: firstResult/maxResults specified with collection fetch; applying in memory!

How can I achieve pagination in such case without any performance hit ?

from spring-data-jpa-datatables.

darrachequesne avatar darrachequesne commented on June 4, 2024

Are you applying any filtering/sorting on the lines? If not, you could lazily fetch the lines, after you've retrieved a list of Orders.

What's happening here (as you've certainly understood) is that, since Hibernate doesn't know how many lines it eventually needs, it fetches all those lines in memory.

from spring-data-jpa-datatables.

pshingavi avatar pshingavi commented on June 4, 2024

Thank you for the quick response :)

Yes I have a Specification which filters on the line items too.

from spring-data-jpa-datatables.

darrachequesne avatar darrachequesne commented on June 4, 2024

In that case, that line here https://github.com/darrachequesne/spring-data-jpa-datatables/blob/master/src/main/java/org/springframework/data/jpa/datatables/repository/SpecificationFactory.java#L106 might cause your issue, since it add a FETCH JOIN for every related attributes.

from spring-data-jpa-datatables.

pshingavi avatar pshingavi commented on June 4, 2024

That's correct.

Adamantly backtracking to use custom query using @query and Pageable in my Repository :(

from spring-data-jpa-datatables.

darrachequesne avatar darrachequesne commented on June 4, 2024

@pshingavi Hi! I've just published v3.0, could you please try it, and see whether it fixes your issue please?

from spring-data-jpa-datatables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.