The individual does not have much contact with the transaction, but in fact the transaction is a more important part of a project, the transaction pattern is taken out to discuss with you, more is based on this discussion can learn more transaction processing mode.
Take MySQL for example:
Once the transaction mode is executed, the MySQL autocommit mode needs to be turned off, and then the SQL is submitted sequentially, and if it is passed, the success and related processing are returned.
Do not know how people generally design?
can be specific to the code logic of the steps and scenarios to apply the introduction!
Reply content:
The individual does not have much contact with the transaction, but in fact the transaction is a more important part of a project, the transaction pattern is taken out to discuss with you, more is based on this discussion can learn more transaction processing mode.
Take MySQL for example:
Once the transaction mode is executed, the MySQL autocommit mode needs to be turned off, and then the SQL is submitted sequentially, and if it is passed, the success and related processing are returned.
Do not know how people generally design?
can be specific to the code logic of the steps and scenarios to apply the introduction!
This is very simple, the operation of the operation is generally operating 2 and above the multi-table operation, if one of the tables of SQL execution fails, then all the SQL execution undo, that is, the transaction rollback to the original state, the bank transfer operation is certainly something, Zhang San will 100 yuan to John Doe, Zhang San account-100 yuan, John Doe account + 100 Yuan, if the Zhang San operation-100 failure, then John Doe +100 also failed, if not things, or Zhang Sanxi dead, or the bank died.