by mintplant · 8y ago · 0 comments
My security sense is tingling. Sounds like a convenient opening for me to finagle your app into an unexpected state (by crafting requests that trigger update failures, interrupting execution at targeted points).
Checking first and failing can still be problematic without the right database isolation setting.
Better to try it and catch the database error (which might include another unique constraint other than primary key... depending on db design).