It is not a specific technical issue. I just come here to ask you a solution. For example, if there is a record in the database, the field is as follows: idfile1avatar.png, a record corresponds to a file. If the delete operation needs to delete the file corresponding to the record in the database at the same time, if the number is guaranteed... it is not a specific technical issue. I just come here to ask you a solution.
For example, if there is a record in the database, the field is as follows:
Id file
1 avatar.png
A record corresponds to a file. If the delete operation needs to delete the database record at the same time, what is the "atomicity" of the database deletion operation and file deletion "?
Reply content:
It is not a specific technical issue. I just come here to ask you a solution.
For example, if there is a record in the database, the field is as follows:
Id file
1 avatar.png
A record corresponds to a file. If the delete operation needs to delete the database record at the same time, what is the "atomicity" of the database deletion operation and file deletion "?
Use the database transactions to complete these two operations. The transaction itself is atomic.