I was testing a multi threaded transaction that processes records from the same VSAM file to process records faster. But I am getting ENQUEUE FCDSRECD condition during the following scenario and the transactions hangs.
Note : Task1 Task 2 and Task 3 are task IDs of same transaction name FFTH
1)TASK1 read REC1 in update mode at 00:00:01, 111 milli seconds
2)TASK2 read REC1 in update mode at 00:00:01, 111 milli seconds (VSAM gives exclusive lock to the file to TASK2 and TASK1 waits)
3)TASK2 issues a rewrite at at 00:00:01, 119 milli seconds
4)TASK3 issues a SYNCPOINT at 00:00:01, 120 milli seconds and as a result I believe the exclusive lock held by TASK 2 is lost ? Am I correct ?
5)As the lock is release TASK1 also gets to read-update the record and issues rewrite at 00:00:01,121 milli seconds
6)All txns goes to wait and ENQUEUE FCDSRECD is raised.
During Multi threading does the issual of syncpoint release the exclusive read-update lock held by another task ?
Is there an solution to work around this issue ?