springboot affairs

1. The isolation level of the transaction

 

 

 

 

2. Business case

2.1 Normal logic addition

2.2 Set error logic to add

After the program reported an error, the new data operation was performed, which is not what we expected.

2.3 Set the transaction error logic to add

Add transaction : @Transactional(propagation=Propagation.REQUIRED)

Refresh constantly, the database, you can see, after the error is reported, the transaction is controlled, and no more new data is added! !

Guess you like

Origin blog.csdn.net/u011066470/article/details/114464825