Overview
When a human task is assigned to a group of potential owners, for example, Everyone in the WebSphere process Server or a group work item, multiple members within the group attempt to declare a task at the same time. In previous versions of WebSphere Process Server, the only way to eliminate concurrent exceptions was to encapsulate the query that determines and declares the task in the synchronization block (or to use a reentrant lock in java™5). There are some drawbacks to the synchronization method, which are caused by the following reasons:
The synchronization block executes before the employee query completes on the work item. This causes the thread to block when accessing the task, not just the user requests that access the task and team members.
The possibility remains that the synchronization block is limited to one JVM and the request is routed to another node in the cluster and causes a concurrency exception in the receiving node.
Early statement-task methods
In earlier versions of WebSphere Process Server, it was stated that the human task method was called two times, first by querying the available tasks in the database, and then by declaring the tasks returned by the first query. Both of these methods revolve around the synchronized block, which means that only one thread at a time can execute the code, as shown in Figure 1.
Figure 1. Synchronous access when declaring a human task
A new way to affirm a task
In the WebSphere process Server V7, the way to declare a task is to use a query table, combined with the query and declaration methods that were used to eliminate the need for the synchronization block earlier. This provides multithreaded concurrent access to human tasks in the database, as shown in Figure 2.
Figure 2. Query table task Access when a human task is declared
In this article, you will examine the new method using both the synchronization method and the query table method, proving that the new method does not cause some form of concurrency exception, as advertised.