[Dbix-class] Savepoint support (MySQL, Pg and Oracle)

Cory Watson jheephat at gmail.com
Tue Oct 23 01:26:06 GMT 2007


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 !=3D 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: savepoints.diff
Type: application/octet-stream
Size: 6728 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20071022/79=
ea6dc1/savepoints-0001.obj


More information about the DBIx-Class mailing list