org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2

Atlassian JIRA | Brydie McCoy [Atlassian] | 6 years ago
  1. 0

    My Project Name: AAAA My Chain Name: AAAA In one instance I tried to update an existing job to have the name AAAA. I got a validation error. I should theoretically be able to name my plan like this shouldn't I? During an attempt to reproduce the above behaviour, I tried to create a _new_ Job with the name AAAA. This submitted successfully. However now I get a whole bunch of other exceptions: {code} 2010-09-30 10:17:41,755 ERROR [1638360365@qtp-1196121930-6] [FiveOhOh] 500 Exception was thrown. org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2 at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.bamboo.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) {code} The getPlanByName method only looks at the project name and plan name in the build table. And hence will return both the chain and the job. So we need to either a) prevent people from creating jobs with the same name as a plan (though this behaves the opposite to how we handle the keys) b) fix the getPlanByName method, and any other use cases which die because of the duplication.

    Atlassian JIRA | 6 years ago | Brydie McCoy [Atlassian]
    org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2
  2. 0

    My Project Name: AAAA My Chain Name: AAAA In one instance I tried to update an existing job to have the name AAAA. I got a validation error. I should theoretically be able to name my plan like this shouldn't I? During an attempt to reproduce the above behaviour, I tried to create a _new_ Job with the name AAAA. This submitted successfully. However now I get a whole bunch of other exceptions: {code} 2010-09-30 10:17:41,755 ERROR [1638360365@qtp-1196121930-6] [FiveOhOh] 500 Exception was thrown. org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2 at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.bamboo.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) {code} The getPlanByName method only looks at the project name and plan name in the build table. And hence will return both the chain and the job. So we need to either a) prevent people from creating jobs with the same name as a plan (though this behaves the opposite to how we handle the keys) b) fix the getPlanByName method, and any other use cases which die because of the duplication.

    Atlassian JIRA | 6 years ago | Brydie McCoy [Atlassian]
    org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2
  3. 0

    After upgrade from 2.6 to 2.7.2, editing the Job Details will show the following exception: {code} Stack Trace: org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 36 at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.bamboo.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:89) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy2.getPlanByName(Unknown Source) {code} Steps to replicate the problem: # Upgrade the instance from 2.6 to 2.7.2 # Go to a project # Edit stages # Configure *Default Job* # Do not change anything make sure the *Job Name: Default Job* # Save \\ Current workaround is to change the problematic job, *Job Name* to others beside *Default Job*

    Atlassian JIRA | 6 years ago | Zed Yap [Atlassian]
    org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 36
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    After upgrade from 2.6 to 2.7.2, editing the Job Details will show the following exception: {code} Stack Trace: org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 36 at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.bamboo.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:89) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy2.getPlanByName(Unknown Source) {code} Steps to replicate the problem: # Upgrade the instance from 2.6 to 2.7.2 # Go to a project # Edit stages # Configure *Default Job* # Do not change anything make sure the *Job Name: Default Job* # Save \\ Current workaround is to change the problematic job, *Job Name* to others beside *Default Job*

    Atlassian JIRA | 6 years ago | Zed Yap [Atlassian]
    org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 36
  6. 0

    On Oracle (but seen on HSQL too): 2009-07-20 16:27:18,357 ERROR [main] [UpgradeManagerImpl] org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2 org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2 at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationHibernateDao.getShippedWithBamboo(ElasticImageConfigurationHibernateDao.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy23.getShippedWithBamboo(Unknown Source) at com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationAccessorImpl.getElasticImageConfigurationShippedWithBamboo(ElasticImageConfigurationAccessorImpl.java:48) at com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationManagerImpl.getElasticImageConfigurationShippedWithBamboo(ElasticImageConfigurationManagerImpl.java:57) at com.atlassian.bamboo.upgrade.tasks.UpgradeTask1310UpdateEBSSnapshot.doUpgrade(UpgradeTask1310UpdateEBSSnapshot.java:60) at com.atlassian.bamboo.upgrade.UpgradeManagerImpl.runUpgradeTask(UpgradeManagerImpl.java:141) at com.atlassian.bamboo.upgrade.UpgradeManagerImpl.doUpgrade(UpgradeManagerImpl.java:97) at com.atlassian.bamboo.upgrade.UpgradeLauncher.upgradeAndStartBamboo(UpgradeLauncher.java:104) at com.atlassian.bamboo.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:37) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.atlassian.bamboo.server.Server.main(Server.java:60) 2009-07-20 16:27:18,358 INFO [main] [UpgradeManagerImpl] Completed upgrade task 1310 with errors.

    Atlassian JIRA | 7 years ago | Marek Went [Atlassian]
    org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.dao.IncorrectResultSizeDataAccessException

      query did not return a unique result: 2

      at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException()
    2. Hibernate
      HibernateTemplate.execute
      1. org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590)
      2. org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353)
      3. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)
      4. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
      4 frames
    3. com.atlassian.bamboo
      PlanHibernateDao.getPlanByName
      1. com.atlassian.bamboo.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:83)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames