To use a transaction

xiaoxiao2021-03-06  112

To use a transaction

The question now thinks:

1. There are two major categories: there are two categories:

(1) Data is not matching

(2) System reasons, three cases:

A, capacity and memory

B, SQL itself

C, other reasons for systems

2. The storage method of data in the transaction, mainly the following questions:

(1) What data is temporarily placed after executing the SQL statement, including the original data?

(2) Is the original data change in the transaction in the process of transaction, if the system is changed, the system is interrupted, the data is rolled back, and the data used in it is from which it comes from?

3, one-time update and approval

(1) If you need a one-time update, what is the perfect solution?

4, can this transaction processing?

DIM CN As Sqlclient.sqlConnection

Dim cm as sqlclient.sqlcommand

Dim Tr As Sqlclient.sqltransaction

Tr = cn.begintransaction ()

cm.transaction = tr

Try

While condition

Try

cm.commandtext = "..."

cm.executenonquery ()

Catch exception

END TRY

End while

Tr.commit ()

Catch exception

Tr.rollback ()

END TRY

5. How does DataRow's RowState cooperate with a transaction?

转载请注明原文地址:https://www.9cbs.com/read-100223.html

New Post(0)