Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-97178

BatchUpdateException in scalar variable '@P1where' during SQL Server upgrade from 7.0 to 7.1

    Details

      Description

      Steps to reproduce:

      1. Start Liferay 7.0 with fixpack-40 or lower and using SQL Server as database.
      2. Create two site. One would be child of the other one.
      3. Enable local staging in Parent Site
      4. Enable local staging in Child Site
      5. Stop that Liferay 7.0 instance
      6. Start the database upgrade process to Liferay 7.1. 

      Expected behavior
      Upgrade process finishes without errors.

       Actual behavior
      Upgrade process throws this exception

      2019-09-06 09:16:36.330 INFO  [main][UpgradeProcess:107] Failed upgrade process com.liferay.portal.upgrade.UpgradeProcess_7_0_5 in 51 ms
      com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.BatchUpdateException: Must declare the scalar variable "@P1where".
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:176)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:143)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:125)
      	at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:151)
      	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:85)
      	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:173)
      	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:106)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:55)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.BatchUpdateException: Must declare the scalar variable "@P1where".
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:142)
      	at com.liferay.portal.upgrade.UpgradeProcess_7_0_5.doUpgrade(UpgradeProcess_7_0_5.java:48)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:96)
      	... 12 more
      Caused by: java.sql.BatchUpdateException: Must declare the scalar variable "@P1where".
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:1132)
      	at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:125)
      	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
      	at com.liferay.portal.kernel.dao.jdbc.AutoBatchPreparedStatementUtil$ConcurrentBatchInvocationHandler.lambda$_executeBatch$0(AutoBatchPreparedStatementUtil.java:222)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

       

        Attachments

          Activity

            People

            • Assignee:
              summer.zhang Summer Zhang
              Reporter:
              pablo.calvo Pablo Calvo (Inactive)
              Participants of an Issue:
              Recent user:
              Clarissa Velazquez
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 weeks, 3 days ago

                Packages

                Version Package
                7.1.10 DXP FP14
                7.1.X
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                Master