Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 M1
    • Fix Version/s: 1.0 M2
    • Component/s: Mapping
    • Labels:
      None

      Description

      @Indexed(unique = true)
      private String name;

      allows me to store two entities with same name.

        Activity

        Hide
        Jon Brisbin added a comment -

        Added test for unique index fix. The test demonstrates how clean up has to be handled for unit tests, otherwise the indexes are not re-created if the collection is deleted.

        Show
        Jon Brisbin added a comment - Added test for unique index fix. The test demonstrates how clean up has to be handled for unit tests, otherwise the indexes are not re-created if the collection is deleted.
        Hide
        Hari Gangadharan added a comment -

        The fix is not complete. In M2 the object is not saved; however it acts as if the record is saved. A new Object Id is generated and no exception is thrown. Expected is MongoException.DuplicateKey or that exception wrapped in a RuntimeException.

        Ref: http://forum.springsource.org/showthread.php?107255-MongoDB-No-exception-when-saving-dup-to-Indexed(unique-true)

        Hari Gangadharan

        Show
        Hari Gangadharan added a comment - The fix is not complete. In M2 the object is not saved; however it acts as if the record is saved. A new Object Id is generated and no exception is thrown. Expected is MongoException.DuplicateKey or that exception wrapped in a RuntimeException. Ref: http://forum.springsource.org/showthread.php?107255-MongoDB-No-exception-when-saving-dup-to-Indexed(unique-true ) Hari Gangadharan
        Hide
        Oliver Gierke added a comment -

        It seems the behavior you see is due to a corner case dealing with the repository subsystem creating a duplicate index. Would you mind opening a new ticket? We prefer new ones over reopened ones as this one is bound to the M2 milestone which was released already.

        Show
        Oliver Gierke added a comment - It seems the behavior you see is due to a corner case dealing with the repository subsystem creating a duplicate index. Would you mind opening a new ticket? We prefer new ones over reopened ones as this one is bound to the M2 milestone which was released already.

          People

          • Assignee:
            Jon Brisbin
            Reporter:
            Thomas Würsch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: