Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-729

Several problems with lazy loading and discrepancies to iBatis 2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0 Beta 8
    • 3.0 Beta 8
    • None
    • None

    Description

      We're migrating an application from iBatis 2 to iBatis 3. The old application used lazy loading heavily for fetching of object graphs.

      We've found some problems (probably not all qualify as bugs):

      1. With lazy loading enabled a setter for the collection property is required. Otherwise you get null values when accessing the collection.

      2. When any property (eager or lazy) is accessed all lazy properties are fetched at once. In our application (which uses the eager properties for list labels) this means no benefit in using lazy loading at all. I would qualify this as a bug.

      3. Building on top of 2 I liked the way iBatis 2 loaded only the accessed lazy property if it was accessed. I read the reasons for changing this in iBatis 3 but would argue for a configuration option to specify this behaviour.

      I've created a unit test which shows each of the behaviours.

      If I can help in any way please let me know. Right now I'm still somewhat lost in the iBatis 3 code base.

      Attachments

        1. ibatis-lazyloading.zip
          9 kB
          Dominik Mähl

        Activity

          People

            cbegin Clinton Begin
            dmaehl Dominik Mähl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: