laminas-api-tools / api-tools-admin-ui

Laminas API Tools Admin UI module
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

Create new Service for Doctrine causes race condition #12

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

When using Doctrine and creating a new service if more than one entity is selected a race condition occurs when both entities are submitted to be created. This is caused because creating a new resource invokes code generation and the two jobs are submitted simultaneously.

The jobs should use a promise object to run one at a time.

p.s. I thought this was already reported. It's been around forever.


Originally posted by @TomHAnderson at https://github.com/zfcampus/zf-apigility-admin-ui/issues/109

weierophinney commented 4 years ago

Given the recent uptick in Doctrine contribution to Apigility I would like to bump this up to a higher priority.

ping @jguittard


Originally posted by @TomHAnderson at https://github.com/zfcampus/zf-apigility-admin-ui/issues/109#issuecomment-256205342

TomHAnderson commented 4 years ago

For anyone needing a work-around, and you choose to create all your Doctrine endpoints at the same time, you may run the application through the php internal server php -S localhost:8080 -t public public which is single threaded and will not cause a race condition.