Re: savepoint API
| From: | Kouber Saparev | Date: | Tue, 18 Jul 2006 14:09:36 +0000 |
| Subject: | Re: savepoint API | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43515@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
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).I think it's ok like that, since you can only move "backwards" to savepoints, i.e. rollbacking. Once you rollback to a savepoint, you cannot access a savepoint which was defined after the current savepoint - which is of course normal, every statement after the savepoint should be "rolled back". So, providing an optional string parameter to rollback(), just like you've implemented it, sounds reasonable to me. Regards, -- Kouber Saparev http://kouber.saparev.com