Understanding how transactions are implemented