Mysql cannot use the "transaction" rollback requirement to create a table: due to the original design, add a piece of data to the "category table, create "category account table" and "category account Attribute Table" respectively ".? My original thought was to expect the above series of actions to be a thing. If an exception occurs, the result would be that the database insertion was unsuccessful and the number
Mysql cannot use the "transaction" rollback requirement to create a table: due to the original design, add a piece of data to the "category table, create "category account table" and "category account Attribute Table" respectively ". ? My original thought was to expect the above series of actions to be a thing. If an exception occurs, the result would be that the database insertion was unsuccessful and the number
Mysql cannot roll back a table created using transactions.
Requirement: to add a piece of data to the "Category Table", you need to create the "category account table" and "category account Attribute Table" respectively ".
?
My original thought was to expect the above series of actions to be a thing. If an exception occurs, the result would be that the database insertion was unsuccessful and the database creation failed, but it was tested for two days, I still cannot use many spring transaction methods, but there is no problem as long as no database is created. Therefore, I suspect that creating a table does not actually support transactions.
?
So how can we solve the above requirements?
Solution: Use try {} catch {} to "package" the above action. If an exception occurs, catch the catch and delete the table in the catch, delete data and perform other operations to simulate rollback.