|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I've written a pseudo-transaction library to provide _some_ level of atomisation and rollback when using MyISAM. I find it very useful and I'm posting here to see if anyone else would. Motivation: The key motivation was for testing - run an entire web request with all the DB work that goes on and then after you've finished output to the client roll everything back to where it was at the beginning. Caveat: It's not really meant for a production environment - it's not meant to provide any level of transactional integrity since, if your process or db connection dies so to does any hope of being able to rollback. It is quite useful to rollback if the database throws an error back at one of your updates/inserts though... It's about 300 lines of PHP... it uses about 2 lines of code to hook into your existing DB Library and leverages temporary tables in the database to effectively back-up the data you're changing. I'm very happy to post the code somewhere and open source it - if anyone would like it!?? :-) There's more about it here: http://www.icommunicate.co.uk/articl...ansactions_20/ J. |
|
![]() |
| Outils de la discussion | |
|
|