Re: undefined behaviour for sub-transactions?

Jochen Wiedmann <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
On 11/15/05, Tyler MacDonald <[email protected]> wrote:

> It says,
>
>            Enable transactions (by turning "AutoCommit" off) until the next
>            call to "commit" or "rollback". After the next "commit" or "roll-
>            back", "AutoCommit" will automatically be turned on again.
>            If "AutoCommit" is already off when "begin_work" is called then it
>            does nothing except return an error. If the driver does not support
>            transactions then when "begin_work" attempts to set "AutoCommit"
>            off the driver will trigger a fatal error.

Ok, let's quote. :-) Here's an excerpt from the AutoCommit flags
documentation. It's a paragraph from the section on "Databases in
which a transaction must be explicitly
started":

           To do this, the driver will automatically begin an explicit trans-
           action when "AutoCommit" is turned off, or after a "commit" or
           "rollback" (or when the application issues the next database opera-
           tion after one of those events).

           In this way, the application does not have to treat these databases
           as a special case.

In other words, the rationale is *not* using begin_work, but simply
setting AutoCommit to off. I always found this to work as expected and
sufficiently portable.


Jochen

--
Often it does seem a pity that Noah and his party did not miss the
boat. (Mark Twain)

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.