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

Incorrect syntax near the keyword 'MERGE' under Source Control

    Details

      Description

      After upgrading JIRA DVCS Connector Plugin to latest version (2.0.11), users hit into error like this:

      2014-08-07 19:41:52,461 http-bio-80-exec-6 ERROR admin 1181x4x4 1qbcxv0 10.60.0.171 /secure/admin/ConfigureDvcsOrganizations!default.jspa [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
      Database:
      	- name:Microsoft SQL Server
      	- version:11.00.3128
      	- minor version:0
      	- major version:11
      Driver:
      	- name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase
      	- version:1.2.4
      
      java.sql.SQLException: Incorrect syntax near the keyword 'MERGE'.
      com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
      Database:
      	- name:Microsoft SQL Server
      	- version:11.00.3128
      	- minor version:0
      	- major version:11
      Driver:
      	- name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase
      	- version:1.2.4
      
      java.sql.SQLException: Incorrect syntax near the keyword 'MERGE'.
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:48)
      	at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:52)
      	at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:39)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.createActiveObjects(ActiveObjectsServiceFactory.java:136)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$000(ActiveObjectsServiceFactory.java:51)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:65)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:61)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects$MemoizingSupplier.get(DelegatingActiveObjects.java:156)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.executeInTransaction(DelegatingActiveObjects.java:133)  <+3>
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	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.$Proxy2402.executeInTransaction(Unknown Source)
      	at com.atlassian.jira.plugins.dvcs.dao.impl.OrganizationDaoImpl.getAll(OrganizationDaoImpl.java:137)
      	at com.atlassian.jira.plugins.dvcs.service.OrganizationServiceImpl.getAll(OrganizationServiceImpl.java:54)
      	at com.atlassian.jira.plugins.dvcs.webwork.ConfigureDvcsOrganizations.loadOrganizations(ConfigureDvcsOrganizations.java:85)  <+3>
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:381)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:370)
      	at com.atlassian.velocity.htmlsafe.introspection.UnboxingMethod.invoke(UnboxingMethod.java:30)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
      	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507)
      	at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:282)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
      	at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      	at org.apache.velocity.Template.merge(Template.java:328)
      	at org.apache.velocity.Template.merge(Template.java:235)
      	at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
      	at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBodyImpl(DefaultVelocityManager.java:117)
      	at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBody(DefaultVelocityManager.java:97)
      	at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.toWriterImpl(DefaultVelocityTemplatingEngine.java:146)
      ...
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.sql.SQLException: Incorrect syntax near the keyword 'MERGE'.
      	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
      	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
      	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
      	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1166)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1119)
      	at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
      	at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
      	at net.java.ao.DatabaseProvider.executeUpdate(DatabaseProvider.java:2309)
      	at net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2379)
      	at net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2342)
      	at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:99)
      	at net.java.ao.EntityManager.migrate(EntityManager.java:143)
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:44)
      	... 235 more
      

      Affected Database

      Microsoft SQL Server SQL Server 2005/2008/2012

      WORKAROUND for JIRA 6.2.x only

      Upgrade to DVCS Connector version 2.0.12 via Marketplace

      WORKAROUND for JIRA 6.3.3 only

      Please refer to JRA-39495 for the workaround.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Last commented:
                  3 years, 10 weeks, 3 days ago