CodeIgniter’s Approach To Transactions

Feb 14, 2021

CodeIgniter’s Approach To Transactions

CodeIgniter utilizes an approach to transactions that is very similar to the process used by the popular database class ADODB. We’ve chosen that approach because it greatly simplifies the process of running transactions. In most cases, all that is required is two lines of code.

Traditionally, transactions have required a fair amount of work to implement since they demand that you keep track of your queries and determine whether to commit or rollback based on the success or failure of your queries. This is particularly cumbersome with nested queries. In contrast, we’ve implemented a smart transaction system that does all this for you automatically (you can also manage your transactions manually if you choose to, but there’s really no benefit).