On Wed, 9 Mar 2005 09:47:20 +0100, H.Merijn Brand <[EMAIL PROTECTED]> wrote:
> On Tue, 8 Mar 2005 12:12:23 -0800, Jonathan Leffler
> <[EMAIL PROTECTED]> wrote:
> > 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.
> 
> Uhh, there is much more difference!
> I can workaround a lot of database problems in the commit/rollback calls in my
> E/SQL code that I could not do unless I would be analyzing every do call

I already got bitten by autocommit (badly; I'm keeping quiet here) - I
already *have* to do a load of analysis and other futzing around with
every statement.  Besides, I can't stop userrs from using $dbh->do()
to execute BEGIN WORK, COMMIT WORK or ROLLBACK WORK.  Or from
preparing and executing them.

-- 
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2003.04 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to