Why is my site import failing with a Could not execute JDBC batch update error?

Issue

  • When I attempt to import a site with the Copy as New option selected under Update Data, the import throws a could not execute JDBC batch update error, which is caused by a duplicate entry exception:
Unable to execute background task
com.liferay.exportimport.kernel.lar.PortletDataException: Could not execute JDBC batch update
	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:408)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:381)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.doImportReferenceStagedModel(StagedModelDataHandlerUtil.java:454)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importReferenceStagedModel(StagedModelDataHandlerUtil.java:244)
	at com.liferay.exportimport.internal.portlet.preferences.processor.capability.ReferencedStagedModelImporterCapability.process(ReferencedStagedModelImporterCapability.java:119)
	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletPreferences(PortletImportControllerImpl.java:599)
	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.importLayoutPortlets(LayoutStagedModelDataHandler.java:1689)
	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:932)
	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:148)
	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:381)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:784)
	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:148)
	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:381)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.doImportReferenceStagedModel(StagedModelDataHandlerUtil.java:438)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importReferenceStagedModel(StagedModelDataHandlerUtil.java:296)
	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importReferenceStagedModels(BaseStagedModelDataHandler.java:859)
	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:365)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:381)
	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
[...]
Caused by: java.sql.BatchUpdateException: Duplicate entry '128852176-128141270-1.9-0' for key 'JournalArticle.IX_D3ACAD4A'
[...]

Environment

  • DXP 7.2
  • DXP 7.3
  • DXP 7.4

Resolution

  • This issue is being investigated on LPS-142076.
  • In the meantime, a workaround for this issue is to perform the export with the Mirror import mode selected.

Additional Information

  • This issue occurs when web content is imported twice due to the issue described in LPS-142076.
  • If the data strategy is Mirror instead of Copy as New, the double-import still happens, but the Mirror strategy is prepared for the case when the article already exists, so the web content is just overwritten. However, the Copy as New strategy always tries to insert, which is why we get the duplicate key exception.
  • Read more about Importing/Exporting Sites and Content.

 

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0