Simple understanding of database transaction

These days there are a small partner in the school asked me what matters is that the database, do not want one reply, and write an essay for yourself (here should have a laugh cry expression matching only)

The Encyclopedia Dictionary database transaction is: database transaction (abbreviation: transaction) is a database management system a logical unit during execution by a limited database configuration sequence of operations.

Beginners may listen to these words of hesitated a moment, then I would like to explain, in fact, the transaction itself is SQL code, meaning it can not escape due to the presence of the basic operation of the database: deposit and take.

But then, the transaction is a deposit and take it, and what set it, this is a vivid metaphor: he seemed to love the young lovers who obey the leadership of girls (understand this analogy may not be good , think about boys and girls will work hand in hand in love, of course, if it is male leadership, you can swap roles example of it), to complete a thing or two are successful, all else fails.

This example as we did a similar group of App United States, the first is to point it was suggested that postprandial payment this matter (Affairs), then we can start where to start the next step of the transaction in accordance with the payment transaction, If the user does not want at this point of the takeaway, so good cancel the transaction, transaction cancellation after payment; if users pay, then we will begin payment transactions carried out after the operation.

Transaction How important is it? Also take the example of ordering, similar deposit withdrawals This type of database, I usually kept inside for two tables to save money and get money (if there is a better way to welcome comments and common progress), after paying users after the money, then the data sheet should increase my deposit record (deposit), then wait for the riders to take away the hands of the user, the user points the end, I save the data table should be pumped into me after the money submitted to inch takeaway store data table (withdrawals), giving riders the money we do not say here, since the end of the meal this thing, definitely give here say rider, may be a bit messy.

After ordering this trip itinerary, the user's money to go through my hands, then pumped into the store to once where a particular failure, loss to both sides is not allowed to fail.

Explain a bit messy, no way, after all, the first thing, after a good write

Guess you like

Origin www.cnblogs.com/qzdd/p/11504203.html