In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "what is the use of affairs in the Oracle series". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "what is the use of affairs in the Oracle series".
Review what is a transaction?
An indivisible sub-operation forms a whole, which either succeeds or fails. For example: transfer
Why do you use transactions in retrospect?
If you do not use transactions, for example, for money transfer, it is possible that one user's money increases and the other user's money remains the same.
Review: in programming, which layer can transactions be used for?
Transactions are placed at the business layer
Reviewing how transactions are used in jdbc programming?
Connection.setAutoCommit (false)
Pstmt.executeUpdate ()
Connection.commit ()
Connection.rollback ()
Reviewing how transactions are used in hibernate programming?
Transaction.begin ()
Session.save (new User ())
Transaction.commit ()
Transaction.rollback ()
Reviewing how transactions are used in spring programming?
Spring can be divided into two types.
Programming transactions, coupling
Declarative transaction, decoupling, advocating
Transactions for Oracle are only for DML operations, that is, select/insert/update/delete
Review the beginning of MySQL's transaction: start transaction
Transaction start of Oracle: the first DML operation starts as a transaction
Commit transaction of Oracle
(1) display submission: commit
(2) hide submission: DDL/DCL/exit (sqlplus tool)
Note: commit is the content from the beginning of the transaction to the middle of the transaction commit to the DBF binary file in the ORCL database
Rollback transaction of Oracle
(1) Show rollback: rollback
(2) Hidden rollback: close the window (sqlplus tool), panic, power down
Note: roll back to where the transaction started
Review what is a rollback point?
A flag bit set between operations for future rollback purposes
Review why do you want to set a rollback point? Savepoint a-share rollback to savepoint a
If no rollback point is set, Oracle must roll back to the beginning of the transaction, and a correct action done in the meantime will be undone
Use the savepoint rollback point to set the rollback point a
Savepoint a
Using rollback to savepoint, roll back to rollback point a
Rollback to savepoint a
After the Oracle is submitted or rolled back, is the originally set rollback point still valid?
The original rollback point is invalid.
Why is Oracle able to roll back?
The main mechanism is instance pool
Review the four transaction isolation levels supported by MySQL and the problems that can be solved
(1) read uncommitted-does not solve any shortcomings
(2) read committed-dirty reading. Oracle defaults to
(3) reapatable read-non-repeatable, dirty read, MySQL default
(4) serializable-Phantom reading, non-repeatable, dirty reading, low efficiency
Note: jdbc/dbutils is fast, but annoying to write
Mybaits is medium in speed, but "medium" in writing
Hibernate is slow, but writing "cool"
Two transaction isolation levels supported by Oracle and problems that can be solved
Oracle support: read committed and serializable
Set the transaction isolation level to serializable in Oracle
Set transaction isolation level serializable
Demonstrate what will happen if two users operate the emp table and delete the KING record at the same time?
Because there is an isolation level, it will not occur that both users delete the KING record.
It must be that one user deleted the KING successfully, and if that user did not submit it, another user waited.
The above is all the content of the article "what is the use of transactions in the Oracle series". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.