Poor memory: 92-spring3 Learning (13)-small differences between spring and hibernate database access, 92-spring3-spring
In the Spring data source, autoCommint is set to true by default. That is to say, by default, the statements executed through jdbcTemplate are committed immediately without transaction control.
If you set autoCommint to false. The SQL statement must be displayed before it can be formally submitted.
Some databases do not support transactions to emphasize speed, such as mysql databases using the MyIsam engine. This type of database does not need to be configured for transactions, because it does not have transactions.
For hibernate, when we call the save, update, and other methods of the session, hibernate does not directly send SQL statements to the database, only when the transaction (commit) or flush level cache is committed, the SQL statement is sent to the database and executed.
In short, spring submits SQL statements to the database by default, while hibernate does not submit SQL statements to the database by default.