ActivitiObjectNotFoundException
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2014 10:45 AM
I have the following code, which throws "org.activiti.engine.ActivitiObjectNotFoundException: task 1298828 doesn't exist". If taskService.createTaskQuery() returns a task, how can taskService.getVariableLocal() say milliseconds later that such task doesn't exist? Any ideas?
List<Task> tasks = taskService.createTaskQuery().taskAssignee(user.getName()).list();for (Task task : tasks) { notified = (Boolean) taskService.getVariableLocal(task.getId(), "notified");}
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2014 04:27 AM
In case there is a boundary timer-event on the user-task, which deleted the task OR if another thread completed the task.
org.activiti.engine.ActivitiObjectNotFoundException is a typed exception, meant specifically for these kind of usecases… You can catch it and ignore the task, for example… If you REALLY don't want this, force your DB/transaction to have "Repeatable reads" isolation-level and ensure all API-calls are done in the same transaction if you're okay with phantom task reads (the task is gone, so the data is stale) and slower performance…
org.activiti.engine.ActivitiObjectNotFoundException is a typed exception, meant specifically for these kind of usecases… You can catch it and ignore the task, for example… If you REALLY don't want this, force your DB/transaction to have "Repeatable reads" isolation-level and ensure all API-calls are done in the same transaction if you're okay with phantom task reads (the task is gone, so the data is stale) and slower performance…
