There's more than one way to do things | |
PerlMonks |
Re^3: Automated testing of database classesby jplindstrom (Monsignor) |
on Dec 27, 2004 at 23:07 UTC ( [id://417657]=note: print w/replies, xml ) | Need Help?? |
I can imagine that Sybase and MS SQL Server have identical transaction semantics.
This only works if you can do it consistently, but here is how to nest transactions and limit the rollback scope so that it matches that of e.g. a procedure:
You start with beginning a transaction and immediately saving the transaction to a named savepoint. I've asked around and this doesn't seem to incur very much overhead. If everything works okay, just commit once to end the outermost transaction. If anything goes wrong, first rollback to the named savepoint, then commit the transaction (to make sure it's nested properly). /J
In Section
Seekers of Perl Wisdom
|
|