Lock Database table for schedule system

Hi everybody!

I’m developing a small schedule system with Neos Flow 6.3. External clients ask the schedule system for new tasks and the system will give them a list with some of them.
I have to avoid, that two clients will get the same task. So I have the following sequence in my mind:

  • client 1asks the system
  • system: $scheduleRepository->findOpenTasks()
  • system: $scheduleRepository->setTasksAsReserved()
  • system send tasks to client 1

By finding the open tasks, I have to lock the table for a potential client 2. Is there a way without using pure SQL commands?

Thank you very much for your support!