XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.0 Beta 9
    • None
    • Core
    • None
    • windows xp,jdk 1.6.0

    Description

      org.apache.ibatis.executor.loader.ResultObjectProxy

      public Object invoke(Object o, Method method, Object[] args) throws Throwable {
      ...
      if (!Object.class.equals(method.getDeclaringClass()) && PropertyNamer.isGetter(method.getName()))

      { lazyLoader.loadAll(); }

      ...
      }
      while we set lazyloading, the model will be enhanced by cglib, so !Object.class.equals(method.getDeclaringClass()) is always true
      then if we call getXXX method, PropertyNamer.isGetter(method.getName()) will return true too
      so, ibatis always call lazyLoader.loadAll() if we call getXXX method, even the method is not the lazy loading method which don't use nested sql map

      modifed to this will solve the problem
      public Object invoke(Object o, Method method, Object[] args) throws Throwable {
      ...
      if (!Object.class.equals(method.getDeclaringClass()) && PropertyNamer.isGetter(method.getName())
      && lazyLoader.hasLoader(method.getName()) )

      { //lazyLoader.loadAll(); lazyLoader.load(method.getName()); }

      ...
      }

      Attachments

        Activity

          People

            cbegin Clinton Begin
            daicat carlou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: