There is no such thing as perfect programming, but we shouldn’t be discouraged because programming is a constant pursuit of perfection.

For Spring transactions, first look at the procedure: Method -> tx -> conn -> Spring bean

Conn (conn); commit (conn); rollback (rollback); So connections are important, and spring must manage transactions based on connections. Spring manages connections as beans, and then finds the corresponding connections when transactions we define in annotations or other forms are operated on. You can then do the specific transaction via a connection (CONN). So, remember that connections are important, important markers of transactions.

For more information, follow the public account