search

Home  >  Q&A  >  body text

java中事物是处理数据库的还是spring中的事物啊?哪个大神详细的给解释下,谢谢!

对java的特性一直是门外汉!

大家讲道理大家讲道理2810 days ago601

reply all(4)I'll reply

  • 迷茫

    迷茫2017-04-17 13:29:59

    Business, right? The concept of transactions is for databases. When Java performs database operations, it needs to ensure data integrity and consistency. When adding, deleting, or modifying, transactions must be performed. Transactions can be said to be a process.
    This process has only two results, success or failure.
    In spring, a transaction manager is generally configured. Combined with spring's AOP (aspect-oriented) feature, for example, when executing methods with insert, update, and delete as prefixes or suffixes, the transaction is started and the transaction is submitted after execution.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:29:59

    It is recommended to look at the transaction processing relationship of jdbc first. Because this is the basic foundation, if you understand this, what is in spring is just more beautifully encapsulated.

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 13:29:59

    Concept
    A transaction is a program execution unit that accesses and possibly updates various data items in the database. A transaction is usually caused by the execution of a user program written in a high-level database manipulation language or programming language (such as SQL, C++, or Java) and is defined by statements (or function calls) in the form of begin transaction and end transaction. A transaction consists of all operations performed between the beginning of the transaction and the end of the transaction.

    ====================================

    Spring also supports database transactions.

    However, transactions can be broader to other businesses. The core point is that a transaction consists of all operations performed between the beginning of the transaction (begin transaction) and the end of the transaction (end transaction), and it is atomic. If one operation fails, the transaction will fail. .

    reply
    0
  • 阿神

    阿神2017-04-17 13:29:59

    I don’t understand, what java transaction are you talking about? There is transaction processing to connect to db, you can use jdbc or spring hibernate

    reply
    0
  • Cancelreply