Race condition when modify record
Hi everyone, I'm new to Filament, I have a question: when 2 different users change data (update or delete) at the same time, how to prevent this? I have learned about the handleRecordUpdate function and used lockForUpdate when querying data to be updated, but what about deleting?
3 Replies
Can't you just use
->lockForUpdate()
in the transaction for the delete as well?Of course it will work but as you can see, there is no function for me to override or define my own logic when deleting, the documentation only mentions handleRecordCreate and handleRecordUpdate.
Ah I see now
I suppose you could use your own action instead of the default delete action. Seems like kind of a pain in the ass though