The embodiments of the present application provide a method, device, and storage medium for
processing transactions. For distributed transactions, it is innovatively proposed to add exclusive locks to the
data records involved in the read set during the read phase; during the write phase, the write operations for the write set can be directly executed based on these exclusive locks, and the exclusive locks on the relevant
data records are released immediately after the write operations are completed. The exclusive locks added to the
data records during the write phase can maintain the exclusivity of the
distributed transaction to these data records, which can avoid the problem of write operation
abortion during the write phase. That is, all write operations of the
distributed transaction will surely succeed, which ensures the
atomicity of
distributed transaction processing. In addition, since the exclusive locks are released immediately after the write operations are completed, the lock
holding time of the distributed transaction is only the time required for executing its
transaction logic inherently, which greatly shortens the lock
holding time of the distributed transaction, thereby effectively improving the
throughput of the distributed transaction and improving the
transaction processing efficiency.