Uploaded image for project: 'Hibernate ORM'
  1. HHH-12740

Subselect fetching doesn't work when multiLoad was used

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.13, 5.3.1
    • Fix Version/s: 5.2.18, 5.3.3, 5.4
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      Given some entities loaded into the session via MultiIdentifierLoadAccess.multiLoad() in one batch via a query using an in-clause. These entities have lazy-fetched OneToMany associations annotated with FetchMode.SUBSELECT.
      When accessing these associations, they will be fetched using one query per parent entity, just as if the parent entities had been loaded one by one.

      This creates serious performance issues when using multiLoad as a replacement for directly querying multiple IDs, which we did do utilize 1st level cache.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: