我正在使用工作流程根据数据和要求集将大量pdf从一个位置复制到其他坝位置。我使用以下代码 资产damAsset = manager.createAsset(path,is,mimeType,true); 其中path是目标可执行文件,'is'是inputstream pdf文件,没有元数据 我使用以下语句将元数据应用于目标文件 Node node = damAsset.adaptTo(Node.class); Node mdNode = node.getNode(“jcr:content / metadata”); mdNode.setProperty(“pttitle”,forms.getFileDisplayTitle()); 完成所有文件后,我将终止工作流程 workflowSession.terminateWorkflow(workItem.getWorkflow());
工作流程大部分时间都可正常工作,但由于以下异常,最后一个文件未使用元数据设置。这种异常在重复运行3-4次后随机发生一次。
javax.jcr.InvalidItemStateException: Unable to update a stale item: item.save()
at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:262)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:329)
at org.apache.jackrabbit.core.session.SessionSaveOperation.perform(SessionSaveOperation.java:65)
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: org.apache.jackrabbit.core.state.StaleItemStateException: 1f6fc642-1a20-4cac-abe5-70f903aefde4 has been modified externally
at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:679)
at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:258)
答案 0 :(得分:1)
可以找到以下详细信息: http://wiki.apache.org/jackrabbit/ItemStateManagement
我会检查是否有任何其他与DAM相关的工作流程与您同时进行。
答案 1 :(得分:0)