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

Fail to import the deletion to Custom Filed

Details

    • 2
    • 3

    Description

      Steps to Reproduce:

      1. Start two portals that connect to different databases.
      2. On the first portal, navigate to Control Panel > Configuration > Custom Fields > Document.
      3. Add new custom field for Document.
      4. Export Custom Fields portlet, then import it to the second portal.
      5. Delete the custom field you created in step 3
      6. Assert document does not have the custom field value
      7. Export Custom Fields portlet with deletions included.
      8. Import the previous lar to the second portal with the deletions included

      Expected Results:
      The import process should be successful without errors.

      Actual Results:
      Example PR
      The import process is failed with the following errors:

      2022-03-14 08:15:58.931 ERROR [liferay/background_task-6][LoggerExportImportLifecycleListener:272] Portlet import failed for portlet com_liferay_expando_web_portlet_ExpandoPortlet
      com.liferay.exportimport.kernel.lar.PortletDataException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portlet.documentlibrary.model.impl.DLFileVersionImpl#42742]
      	at com.liferay.exportimport.kernel.lar.BasePortletDataHandler._handleException(BasePortletDataHandler.java:812) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:396) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:422) ~[?:?]
      	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:353) ~[?:?]
      	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl._importPortletInfo(PortletImportControllerImpl.java:1409) ~[?:?]
      	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importFile(PortletImportControllerImpl.java:304) ~[?:?]
      	at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:445) ~[portal-impl.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
      	at com.liferay.change.tracking.internal.aop.CTTransactionAdvice.invoke(CTTransactionAdvice.java:80) ~[?:?]
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
      	at com.sun.proxy.$Proxy88.importPortletInfo(Unknown Source) ~[?:?]
      	at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importPortletInfo(ExportImportLocalServiceUtil.java:195) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:143) ~[?:?]
      	at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:129) ~[?:?]
      	at com.liferay.portal.spring.transaction.BaseTransactionExecutor.execute(BaseTransactionExecutor.java:37) [portal-impl.jar:?]
      	at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39) [portal-impl.jar:?]
      	at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28) [portal-kernel.jar:?]
      	at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:88) [bundleFile:?]
      	at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:63) [bundleFile:?]
      	at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41) [portal-kernel.jar:?]
      	at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72) [bundleFile:?]
      	at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:136) [bundleFile:?]
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:48) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:34) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74) [portal-kernel.jar:?]
      	at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56) [bundleFile:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
      Caused by: com.liferay.portal.kernel.exception.SystemException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portlet.documentlibrary.model.impl.DLFileVersionImpl#42742]
      	at com.liferay.portal.spring.hibernate.LastSessionRecorderUtil.syncLastSessionState(LastSessionRecorderUtil.java:54) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.hibernate.LastSessionRecorderHelperImpl.syncLastSessionState(LastSessionRecorderHelperImpl.java:27) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.spring.orm.LastSessionRecorderHelperUtil.syncLastSessionState(LastSessionRecorderHelperUtil.java:23) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:392) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:375) ~[portal-kernel.jar:?]
      	at com.liferay.expando.exportimport.internal.data.handler.ExpandoPortletDataHandler.doImportData(ExpandoPortletDataHandler.java:130) ~[?:?]
      	at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:392) ~[portal-kernel.jar:?]
      	... 34 more
      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portlet.documentlibrary.model.impl.DLFileVersionImpl#42742]
      	at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1950) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2595) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2495) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2822) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:113) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) ~[hibernate-core.jar:3.6.10.Final]
      	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) ~[hibernate-core.jar:3.6.10.Final]
      	at com.liferay.portal.spring.hibernate.LastSessionRecorderUtil.syncLastSessionState(LastSessionRecorderUtil.java:49) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.hibernate.LastSessionRecorderHelperImpl.syncLastSessionState(LastSessionRecorderHelperImpl.java:27) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.spring.orm.LastSessionRecorderHelperUtil.syncLastSessionState(LastSessionRecorderHelperUtil.java:23) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:392) ~[portal-kernel.jar:?]
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:375) ~[portal-kernel.jar:?]
      	at com.liferay.expando.exportimport.internal.data.handler.ExpandoPortletDataHandler.doImportData(ExpandoPortletDataHandler.java:130) ~[?:?]
      	at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:392) ~[portal-kernel.jar:?]
      	... 34 more
      

      Attachments

        Issue Links

          Activity

            People

              support-lep@liferay.com SE Support
              joyce.wang Joyce Wang
              Felipe Lins Felipe Lins
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                8 weeks, 2 days ago

                Packages

                  Version Package