openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B.J. Reed (JIRA)" <>
Subject [jira] Created: (OPENJPA-1058) Duplicate rows in DB when UniqueConstraint set
Date Fri, 01 May 2009 14:36:30 GMT
Duplicate rows in DB when UniqueConstraint set

                 Key: OPENJPA-1058
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.2.1, 2.0.0
         Environment: DB2
            Reporter: B.J. Reed
             Fix For: 2.0.0
         Attachments: DupRowsInDB.ZIP

WebUser entity has a HashMap of WebUserPreferences.
WebUserPreference has a UniqueConstraint defined on 2 fields.
Can reproduce in DB2 DB with attached DDL.

Basically, what is happening is, that the test case goes through and adds 4 WebUserPreferences
to the WebUser.  Then persists the WebUser.  Then adds 4 more WebUserPreferences to the same
WebUser, same name and web user (constraint columns).  The Entity is then merged.  The WebUser
Entity has the correct 4 WebUserPreferences, but the database has all 8 rows.  Was expecting
to see the first 4 rows be removed from the database (or maybe they should have been updated
with the more recent value data).

Also, even if the second set of values are the same as the first set of values, then there
are still 8 rows in the database, the 4 original rows and the second set of duplicate rows.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message