MySQL transaction with accounting application

前端 未结 2 1099

I have a table like the following:

transaction_id
user_id
other_user_id
trans_type
amount

This table is used to maintain the account transa

2条回答
  •  借酒劲吻你
    2021-01-19 20:35

    Are you using InnoDB tables or MyISAM tables? MySQL doesn't support transactions on MyISAM tables (but it won't give you an error if you try to use them). Also, make sure your transaction isolation level is set appropriately, it should be SERIALIZABLE which is not the default for MySQL.

    This article has a good example that explains the impact of the different isolation levels using an example very similar to yours.

提交回复
热议问题