Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-198

Cache key for accessors can be ambiguous and can cause cast exceptions

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • DataMapper 1.6
    • DataMapper
    • None

    Description

      Example:

      If we have a class "Product" with a property "DefinitionId" and a class "ProductDefinition" with a property "Id", the cache key will be the same for both properties. This will make the DataMapper return always the first property that was configured.

      The problem is the line:
      string key = targetType.FullName + "." + name;
      in GetAccessorFactory.cs and CreateAccessorFactory.cs.

      Changing it to:
      string key = targetType.FullName + "." + name;
      will solve the problem.

      Attachments

        1. AccessorKey.patch
          1 kB
          Bruno Silva

        Activity

          People

            gilles Gilles Bayon
            brunomsilva Bruno Silva
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment