Preface

If you're using Zend MVC and attempting to store transactional data, below is a quick and easy way to handle exceptions while still allowing rollbacks.

The code will essentially ensure that your transaction safely fails if an exception is thrown (i.e. the dreaded Integrity constraint violation: 1062 Duplicate entry) and fall back on your error controller for handling the exception. You can then deal with these exceptions in any manner you see fit by utilising ZendLogWriter_Stream.

Code Example

gist#https://gist.github.com/1216768.js

If you're using Zend MVC and attempting to store transactional data, I'll show you a quick and easy way to handle exceptions while still allowing rollbacks.