This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 642519 - errata.create fails with same keywords
errata.create fails with same keywords
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
540
All Linux
low Severity medium
: ---
: ---
Assigned To: Tomas Lestach
Šimon Lukašík
:
Depends On:
Blocks: sat54-errata
  Show dependency treegraph
 
Reported: 2010-10-13 04:36 EDT by Tomas Lestach
Modified: 2011-03-17 10:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause rhn_err_keywordtmp_eid_uq constrain doesn't allow same keywords associated with a single erratum Consequence errata.create API fails with NonUniqueObjectException, when setting same keywords Fix Duplicates will be removed from the erratum keyword list before storing them. Result Only one keyword will be stored, when setting keyword dupes. No Traceback.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-03-17 10:13:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Lestach 2010-10-13 04:36:41 EDT
Description of problem:
Call errata.create and specify one keyword several time. Call fails.

Version-Release number of selected component (if applicable):
sat540

How reproducible:
always

Steps to Reproduce:
1. use keywords = ['tml-kw1', 'tml-kw2', 'tml-kw1', 'tml-kw2', 'tml-kw3']
in the errata.create call
  
Actual results:
2010-10-13 10:21:54,146 [TP-Processor3] ERROR com.redhat.rhn.frontend.xmlrpc.BaseHandler - Caused by:
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.redhat.rhn.domain.errata.impl.UnpublishedKeyword#tml-kw1]
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:168)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
...

Expected results:
no traceback
Comment 1 Tomas Lestach 2010-10-13 04:41:29 EDT
Our schema supports only a unique keyword for an erratum. Adding check - not to associate two same keywords with an erratum

Fixed in spacewalk: a03aed255654a38d4b08945f2a2f5ffe73d6a5a5
Comment 5 Tomas Lestach 2011-02-14 09:31:19 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
rhn_err_keywordtmp_eid_uq constrain doesn't allow same keywords associated with a single erratum

Consequence
errata.create API fails with NonUniqueObjectException, when setting same keywords

Fix
Duplicates will be removed from the erratum keyword list before storing them.

Result
Only one keyword will be stored, when setting keyword dupes. No Traceback.
Comment 6 Šimon Lukašík 2011-03-02 05:50:06 EST
Taking QA contact. Should be easy to automate.
Comment 8 Šimon Lukašík 2011-03-03 05:12:27 EST
Changing to Verified.

Testing procedure:
Automated test.

Verified against:
spacewalk-java-1.2.39-38
Comment 9 errata-xmlrpc 2011-03-17 10:13:09 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0362.html

Note You need to log in before you can comment on or make changes to this bug.