On 08-Mar-2005 Jonathan Leffler wrote: > I'm keeping this on dbi-dev pro tem. Greg - I suggest you ask the > question on dbi-users. > > > On Tue, 8 Mar 2005 11:01:48 +0000, Tim Bunce <[EMAIL PROTECTED]> wrote: >> On Mon, Mar 07, 2005 at 11:47:32PM -0000, Greg Sabino Mullane wrote: >> > > While I don't have any particular objections, doesn't >> > > Pg (and most other DBMSs supporting savepoints) have >> > > SQL syntax to implement them ? If so, isn't just >> > > >> > > $dbh->do(<savepoint-sql>) >> > > >> > > sufficient ? >> > >> > Sure, but they also have syntax to implement BEGIN and ROLLBACK. > > It isn't wholly clear why we have $dbh->commit an $dbh->rollback; both > could be simulated with $dbh->do on most databases. However, there is > some minor performance advantage on some systems. For example, IBM > Informix Dynamic Server (IDS) recognizes those statements in ESQL/C > and the SQLI protocol used to transfer commands between client code > (such as Perl + DBI) and the server sends a two byte command for > ROLLBACK instead of sending the string. Further, the two byte command > does not have to be parsed and executed - so there is a small, but > barely measurable, performance benefit to using the $dbh->rollback > statement.
Just a small point. I could be wrong (I cannot look it up right now) but I think in ODBC SQLEndTran can issue a rollback or commit on ALL connections. Effectively, it issues the rollback/commit on each connection in the environment. That would be a lot harder to do with $dbh->do since you'd have to do it once per connection. <snipped> Martin -- Martin J. Evans Easysoft Ltd, UK Development