in reply to DB Not UPDATE-ing

Replies are listed 'Best First'.
Re: Re: DB Help Request
by tantarbobus (Hermit) on Sep 14, 2003 at 14:34 UTC

    Do you know which database drivers default to AutoCommit=0? I can't think of any off the top of my head, but I would like to know which ones default to AutoCommit off, if only, because the DBI docs say that it defaults to AutoCommit on:

    The "AutoCommit" and "PrintError" attributes for each connection default to "on". (See "AutoCommit" and "PrintError" for more infor- mation.) However, it is strongly recommended that you explicitly define "AutoCommit" rather than rely on the default. Future ver- sions of the DBI may issue a warning if "AutoCommit" is not explic- itly defined.

    And later goes on to say that the driver should default to AutoCommit on:

    Drivers should always default to "AutoCommit" mode (an unfortunate choice largely forced on the DBI by ODBC and JDBC convention
        While "AutoCommit" defaults to "true", there are cases where this default is not properly supported, and the perl/DBI programmer has to explicitly set it to "false" and then explicitly use the "commit" method as appropriate.

        I ran across one such case when using Oracle 8.1.3 -- I found that a "select ... for update" would cause oracle to generate an error (don't remember what it said, exactly), unless AutoCommit was turned off. This caused some nasty diversions when we were migrating an app from Oracle 7.x, where there was no such problem.