Uploaded image for project: 'JIRA Software Server (including JIRA Agile)'
  1. JIRA Software Server (including JIRA Agile)
  2. JSWSERVER-14023

Pull request synchronization failed when connecting JIRA with MS SQL Server

    Details

      Description

      NOTE: This bug report is for JIRA Software Server. Using JIRA Software Cloud? See the corresponding bug report.

      On JIRA 6.2, connect with MS SQL Server 2008, when synchronizing a Bitbucket repository that contains pull requests, we see the following errors:

      java.sql.SQLException: Incorrect syntax near the keyword 'COMMIT'.
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93)
      	at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy2733.find(Unknown Source)
      	at com.atlassian.jira.plugins.dvcs.dao.impl.RepositoryPullRequestDaoImpl.getCommitByNode(RepositoryPullRequestDaoImpl.java:337)
      	at com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer$4.call(BitbucketSynchronizeActivityMessageConsumer.java:384)
      	at com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer$4.call(BitbucketSynchronizeActivityMessageConsumer.java:374)
      	at com.atlassian.jira.plugins.dvcs.sync.FlightTimeInterceptor.execute(FlightTimeInterceptor.java:25)
      	at com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer.loadPullRequestCommits(BitbucketSynchronizeActivityMessageConsumer.java:373)
      	at com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer.processActivity(BitbucketSynchronizeActivityMessageConsumer.java:185)
      	at com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer.onReceive(BitbucketSynchronizeActivityMessageConsumer.java:125)
      	at com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer.onReceive(BitbucketSynchronizeActivityMessageConsumer.java:52)
      	at com.atlassian.jira.plugins.dvcs.service.MessageExecutor$MessageRunnable.run(MessageExecutor.java:268)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      

      The SQL in question is:

      SELECT COMMIT.ID,COMMIT.* FROM dbo.AO_E8B6CC_COMMIT COMMIT JOIN dbo.AO_E8B6CC_PR_TO_COMMIT PR_TO_COMMIT ON COMMIT.ID = PR_TO_COMMIT.COMMIT_ID JOIN dbo.AO_E8B6CC_PULL_REQUEST PR ON PR_TO_COMMIT.REQUEST_ID = PR.ID WHERE COMMIT.DOMAIN_ID = ? AND PR.ID = ? AND COMMIT.NODE = ?
      

      COMMIT is obviously a reserved keyword and MS SQL Server does not like it to be an alias.

      Impacts

      Pull requests are not synchronized.

      Commits and branches are still synchronized.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Last commented:
                  2 years, 40 weeks, 4 days ago