Home > Back-end >  Consulting a questions about the transaction using. To solve
Consulting a questions about the transaction using. To solve

Time:01-01

ADOConnection1. BeginTrans;//transaction start

Try

ADOQuery1. Append;//this is part of data to be written
ADOQuery1. Post;//this is part of data to be written

ADOConnection1.Com mitTrans;//to commit the transaction

Except,

ADOConnection1. RollbackTrans;//rollback

Question 1, I write is in the use of transaction?

Question 2, this kind of simple code, write only 1 table, it is necessary to use the transaction?

CodePudding user response:

1, yes, I usually use the database transaction to deal with,
2, simply do not need to use transactions,
  • Related