We recently wanted to use savepoints for some things in our tests and I decided to implement support in DBIC.
Support is implemented vix txn_??-esque type calls of svp_begin, svp_rollback and svp_release. Storage/DBI.pm checks for an implemented _svp_??? method and executes it (or warns if it doesn't exist). Calls to debugobj are made if a call to the DBI subclass is going to happen. svp_ calls must happen inside a transaction (checks that transaction_depth != 0). I implemented support in mysql ($dbh->do()), Pg (pg_savepoint and friends) and Oracle ($dbh->do, but does not support svp_release, per oracle docs). No tests are included as SQLite doesn't support savepoints. I intend to add some if I find there are optional MySQL/Pg/Oracle tests in the distro. I'll look into that later. Feedback welcome. I'll work out some tests and commit this somewhere by bugging the channel if/when the time comes. Patch against 0.08 current attached. -- Cory 'G' Watson http://www.onemogin.com
savepoints.diff
Description: Binary data
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]
