A transaction is just valid for that particular session.
It waits for a commit or a rollback.
Transaction aren't really that effective in a web application since the connection to the database seldom is that long.
Just to update a single record in a single table, I would not use transactions, but if you har updating multiple tables, and those changes are connected to each other, and you need to make sure the changes are successful on all of them, then transactions is a good choice.