News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
MySQL Transactions & Why They Can't Be Emulated in PHP
December 15, 2010 @ 12:47:44

On the SitePoint blog there's a new article from Craig Buckler stating that MySQL transactions can't be emulated in PHP and shouldn't be discounted despite many developers seeing them as not much more than a performance hit.

My recent article, "Top 10 MySQL Mistakes Made by PHP Developers" was far more controversial than I expected. Several of the more intriguing responses were from PHP coders who considered transactions to be an unnecessary overhead. With good-quality PHP code, they argued, you don't need transactions or MySQL's InnoDB storage engine. It's certainly true you don't always need transactions.

He gives an example of a situation where database-based transactions would be very useful (inserting customer information) and points out that, despite the best intentions of developers, reducing as many layers and connections between SQL and code is a good thing. Transactions help you conform to the ACID ideas and keep data integrity by only having things in the database that were successful. He includes a small bit on using transactions as well.

0 comments voice your opinion now!
mysql transaction emulate opinion acid integrity mysql


blog comments powered by Disqus

Similar Posts

Daniel Cousineau's Blog: Hierarchical Data With PHP and MySQL

DevShed: Building Site Registration for Web Application Security

Blancer.com: 10 Compelling Reasons to use the Zend Framework

Blond R's Blog: Set up IIS 7 w/ MySQL and PHP 5

Lars Tesmer's Blog: What My Co-Workers and I Learned When Trying to Write Unit Tests for PHPUnit


Community Events





Don't see your event here?
Let us know!


release install developer code configure bugfix interview community wordpress introduction series unittest podcast list library language laravel application threedevsandamaybe api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework