Consider the following algorithm.
increaseScore(studentId, assignmentId, delta)
Set score = studentId's score for assignmentId.
Update studentId's score for assignmentId to score+delta.
Could a concurrent execution of this algorithm lead to violations of any of the transaction properties? If so, identify the properties and give a sample schedule; if not, explain why not.
How would you fix the problems?
Consider the following algorithm.
moveStudent(studentId, sourceSectionId, destinationSectionId)
Compute size of destination section.
If size < max
Remove studentId from sourceSectionId.
Add studentId to destinationSectionId.
Could a concurrent execution of this algorithm lead to violations of any of the transaction properties? If so, identify the properties and give a sample schedule; if not, explain why not.
How would you fix the problems?