Some operations performed against a database make sense only when grouped together. A classic example involves a transfer of funds between two bank accounts. The only way to perform such an operation safely is to use a transaction. Using transactions lets you group SQL statements together into logical, indivisible units of work, each of which can be either all committed or all rolled back.
In this chapter you learned when and how to use transactions in PHP/Oracle applications. The discussion began with a brief overview of Oracle transactions and why you may want to use them in PHP applications built on top of Oracle. Then, it explained how to organize a PHP/Oracle application to effectively control transactions, focusing on the benefits from moving the business logic of a transactional application from PHP to the database. You learned which OCI8 connection function to choose when it comes to using transactions, and how to create simultaneous transactions within the same script. Finally...