Race condition when creating many custom fields

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Medium
    • None
    • Affects Version/s: 4.0.1
    • Component/s: Issue - Fields
    • Environment:

      MySQL 5, OSX

    • 4

      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)
      

        1. 20289.tgz
          10 kB
          MattS

              Assignee:
              Unassigned
              Reporter:
              MattS
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: