Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20705

Duplicate project keys when double clicking "save" on creating a new project

    XMLWordPrintable

Details

    Description

      Issue Summary

      Duplicate project keys when double clicking "save" on creating a new project

      Steps to Reproduce

      1. Select Create and Project
      2. Double click on Save

      Expected Results

      Only one project is created.

      Actual Results

      Two projects are created with the same key in PROJECTS table:

      project_id created_date updated_date project_key title description marked_for_deletion oid
      218759169 2019-09-04 11:58:32 2019-09-04 11:58:32 PKEY TITLE   false 3225703233104165889
      218759170 2019-09-04 11:58:32 2019-09-04 11:58:32 PKEY TITLE   false 3225703233104165890

      The below exception is thrown in the atlassian-bamboo.log and UI when viewing the project:

      org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2; nested exception is org.hibernate.NonUniqueResultException: query did not return a unique result: 2
      	at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:262)
      	at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:386)
      	at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:335)
      	at com.atlassian.bamboo.project.ProjectHibernateDao.getProjectByKey(ProjectHibernateDao.java:123)
      	at sun.reflect.GeneratedMethodAccessor983.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy147.getProjectByKey(Unknown Source)
      	at com.atlassian.bamboo.project.DefaultProjectManager.getProjectByKey(DefaultProjectManager.java:96)
      

      Workaround

      Single click in Save

      Attachments

        Issue Links

          Activity

            People

              achystoprudov Alexey Chystoprudov
              roliveira@atlassian.com Ricardo
              Votes:
              7 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: