Clone
Marcin Cieslak
committed
on 30 Nov 20
LDEV-4944 Synchronise VSA answer allocation
We need to synchronise this operation.
When multiple requests are made to modify the same option… Show more
LDEV-4944 Synchronise VSA answer allocation

We need to synchronise this operation.

When multiple requests are made to modify the same option, for example

to add a VSA answer, we have a case of dirty reads. One answer gets

added, but while DB is still flushing, another answer reads the option

without the first answer, because it is not there yet.

The second answer gets added, but the first one gets lost.

We can not synchronise the method in service  as the "dirty" transaction

is already started before synchronisation kicks in.

We do it in MonitoringController, before transaction starts.

It will not work for distributed environment, though.

If teachers allocate answers on different LAMS servers, we can still get

the same problem. We will need a more sophisticated solution then. Show less