Poor memory: 92-spring3 Learning (13)-small differences between spring and hibernate database access, 92-spring3-spring

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.