A method for updating a database by using a two-phase commit distributed transaction, the method being applied to a participant, and comprising: performing an update operation according to an instruction on updating a target database record in a current transaction after adding a write lock to the target database record; using another transaction, in a transaction information record, whose state is to release the write lock in advance and whose update object involves the target database record as a predecessor transaction of the current transaction, and recording the predecessor transaction of the current transaction in the transaction information record; writing a log of the update operation of the current transaction to a log buffer after receiving a phase 1 prepare request message sent by a coordinator, and sending a write lock advance release request to the coordinator after the writing succeeds; releasing the write lock after receiving a write lock advance release response returned by the coordinator, and setting a state of the current transaction in the transaction information record to releasing the write lock in advance; after persisting the log of the update operation of the current transaction in the log buffer succeeds, sending a phase 1 prepare response message of preparation success to the coordinator after all predecessor transactions of the current transaction are in a commit state or sending a phase 1 prepare response message of preparation failure to the coordinator after any predecessor transaction of the current transaction is in an abort state; and setting the current transaction in the transaction information record to a commit state or an abort state based on an execution result of the current transaction in phase 2. performing an update operation according to an instruction on updating a target database record in a current transaction after adding a write lock to the target database record; using another transaction, in a transaction information record, whose state is to release the write lock in advance and whose update object involves the target database record as a predecessor transaction of the current transaction, and recording the predecessor transaction of the current transaction in the transaction information record; writing a log of the update operation of the current transaction to a log buffer after receiving a phase 1 prepare request message sent by a coordinator, and sending a write lock advance release request to the coordinator after the writing succeeds; releasing the write lock after receiving a write lock advance release response returned by the coordinator, and setting a state of the current transaction in the transaction information record to releasing the write lock in advance; after persisting the log of the update operation of the current transaction in the log buffer succeeds, sending a phase 1 prepare response message of preparation success to the coordinator after all predecessor transactions of the current transaction are in a commit state or sending a phase 1 prepare response message of preparation failure to the coordinator after any predecessor transaction of the current transaction is in an abort state; and setting the current transaction in the transaction information record to a commit state or an abort state based on an execution result of the current transaction in phase 2.