How could I draw the database transaction commit in the sequence diagram?
I want to draw in sequence diagram database transaction commit/rollback process
First, define use cases for the transaction you are modeling. Define versions of the use case for happy path, and each of the rollback scenarios you wish to model. Each of these use case variations can be presented as a separate sequence diagram.
Consider a very simple transaction -- client updates two tables, T1 and T2. Both updates need to succeed, or neither table gets changed. There are three interesting use cases --
So you have three sequence diagrams, one for each case.
The third sequence diagram might look like this: