On Wed, 9 Mar 2005 19:34:51 -0800, Jonathan Leffler
<[EMAIL PROTECTED]> wrote:

> 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.

True, but at least we can offer a clean and consistent interface, that when
used according to the DBI rules offers what it is expected to offer: a stable
and reliable interface to the database in question

We also cannot stop users from calling external scripts/programs that ruin our
dataset or shutdown the database while we are working in it.

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2  on HP-UX 10.20, 11.00 & 11.11,
 AIX 4.3 & 5.2, SuSE 9.1 & 9.2, and Cygwin. http://www.cmve.net/~merijn
Smoking perl: http://www.test-smoke.org,    perl QA: http://qa.perl.org
 reports  to: [EMAIL PROTECTED],                perl-qa@perl.org

Reply via email to