Weedpacket is completely correct. Basically as soon as you send the BEGIN command you are dealing with a complete copy of the database in memory. If anything happens to to keep you from sending COMMIT then all of your changes are lost, which is what you wanted right? If it's not what you wanted then you shouldn't be doing those actions inside a transaction.
Basically you want to use transactions wherever every statement in a multiple statement operation has to be completed for the entire transaction to be valid. A good example would be in a banking situation where you are transfering money from one account to another. First you need to make sure that the amount that you want to transfer exists in the first account, then you want to remove it from that account and deposit it in the second account. If either of these last 2 steps fails you want them both to fail. You wouldn't want to deposit funds that you couldn't withdraw from the 1st account, this would be creating money. Also you wouldn't want to withdraw funds from the first account and never deposit them in the second, this would make your customer very angry and cause much confusion. So the last two steps need to be inside a transaction.