i have cart table where we maintain the list of item details (unique cart identifier for each item) .
when user check out the item ,a thread will pick the job (i.e creation of row in cart table and creation of item object then creation job to other pool for xml/db processing).
my issue is when user check out a item and delete the item with small gap (20 sec) . pool1 is creating the row in Cart table and creating the object and passing job to pool2 for xml processing ,during the time deletion job in pool 1 is started deleted the row in cart table . As a result during processing job in pool2 i'm validating the whether row exist or not and getting the error.
i can't create a lock on the object since it is complex object which has several shared sub class object by other threads.
can any one help how reduce the time of processing in 2rd thread pool or to make some wait for 1st thread pool or any suggestion to solve this issue....