Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-20289

Race condition when creating many custom fields

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Medium
    • None
    • 4.0.1
    • Issue - Fields
    • MySQL 5, OSX

    Description

      I wrote a REST plugin that has a resource to create lots of text custom fields. Occasionally I see an error that looks suspiciously like some id is not being flushed out of a cache in the GenericDelegator.
      Using CoreFactory.getGenericDelegator().refreshSequencer(); after every call to createCustomField() seems to fix it.

      ~Matt

      2010-01-28 18:10:34,100 http-8080-Processor19 ERROR anonymous 65409x18x1 - http://localhost:8080/rest/jiraperformance/1.0/createfields.json 
      [consultingtoolsmiths.jira.plugins.CreateFieldsResource]
       org.ofbiz.core.entity.GenericEntityException: while inserting: 
      [GenericEntity:CustomField]
      [customfieldsearcherkey,com.atlassian.jira.plugin.system.customfieldtypes:textsearcher][description,A text custom field]
      [customfieldtypekey,com.atlassian.jira.plugin.system.customfieldtypes:textfield]
      [name,Test text field 80][id,10074] 
      (SQL Exception while executing the following:
      INSERT INTO customfield 
      (ID, CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, cfname, DESCRIPTION, defaultvalue, FIELDTYPE, PROJECT, ISSUETYPE) 
      VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry '10074' for key 1))
      	at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:123)
      	at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:88)
      	at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63)
      	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:480)
      	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:460)
      	at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77)
      	at com.atlassian.core.ofbiz.util.EntityUtils.createValue(EntityUtils.java:64)
      	at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.createCustomField(DefaultCustomFieldManager.java:140)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              73d805a2526b MattS
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: