Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-2982

SimpleExpression.ToString() can result in unwanted loading of lazy objects

    Details

    • Type: Patch
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects versions: 3.2.0.GA
    • Fix versions: 3.3.0.CR1
    • Components: Core
    • Labels:
      None
    • Sprint:

      Description

      SimpleExpression.ToString() can result in unwanted loading of lazy objects. This is because it called value.ToString() to get a string representation of an entity. The entity ToString() can access lazy loaded properties thus in unwanted loading of entities.

      Code changed so that the string value is retrieved via ObjectUtils. The implementation of ObjectUtils now checks if the supplied instance implements INHibernateProxy and used that to return an identification without calling .ToString().

      A patch is supplied via a pull request at : https://github.com/nhibernate/nhibernate-core/pull/36

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ramon.smits Ramon Smits
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?