Hi , what I understood…
OCC-
select forUpdate salesTable
where salesTable.SalesId == 'SO-1001';
salesTable.CustGroup = 'RETAIL';
salesTable.update();
If both user trying to update at same time. It can detect the concurrency conflict.
PCC-
ttsBegin;
select pessimisticLock forUpdate inventSum
where inventSum.ItemId == 'ITEM-A';
if (inventSum.AvailPhysical >= 7)
{
inventSum.AvailPhysical -= 7;
inventSum.update();
}
ttsCommit;
Here The first transaction obtains a lock on the record.
The second transaction has to wait until the first transaction completes.
concurrencyModel()- It returns the table's configured concurrency model.
Am I correct?
Pls advise, thanks