savepoint API

From: Date: Sat, 15 Jul 2006 16:23:34 +0000
Subject: savepoint API
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-43483@lists.php.net to get a copy of this message
Hi, Lorenzo and I have implemented SAVEPOINT support into MDB2. We have also added support for automatic setting of SAVEPOINTs into the nested transaction API (can be disabled by setting the 'savepoint_format' option to false). For those of you who dont know what SAVEPOINT are: Using a SAVEPOINT you can attach a name to specific "steps" in your transaction and then rollback to that "step" without rolling back the entire transaction. See the documentation of your favorite RDBMS for details. Now I have a question about the API. For handling transactions we have 3 methods who's names are taken from pecl::pdo: beginTransaction() commit() rollback() For savepoint support we have added: setSavepoint() releaseSavepoint() Since rolling back to a specific savepoint uses "ROLLBACK" as well we have simply added this feature to rollback() (if a string is passed to rollback its assumed that the user is rolling back to a savepoint with that string as its name). Now the question is should we should roll setSavepoint() into beginTransaction(), and releaseSavepoint() into commit() similar to how we have done so already for rollback()? Or rather if we should move the savepoint support out of rollback() into a separate method rollbackSavepoint()? regards, Lukas

« previous php.pear.dev (#43483) next »