Transaction management is one of the trickier subjects in computer science. One single wrong line, one unpredicted situation, and your data and/or your user will suffer the consequences.
So, it would be nice if we could count on the server to do it for us. And most of the time we can, so let me show you how to do it.