Re: undefined behaviour for sub-transactions?

Re: undefined behaviour for sub-transactions?

am 15.11.2005 08:51:40 von Jochen Wiedmann

On 11/15/05, Tyler MacDonald wrote:

> It says,
>
> Enable transactions (by turning "AutoCommit" off) until the ne=
xt
> call to "commit" or "rollback". After the next "commit" or "ro=
ll-
> back", "AutoCommit" will automatically be turned on again.
> If "AutoCommit" is already off when "begin_work" is called the=
n it
> does nothing except return an error. If the driver does not su=
pport
> transactions then when "begin_work" attempts to set "AutoCommi=
t"
> 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 tran=
s-
action when "AutoCommit" is turned off, or after a "commit" or
"rollback" (or when the application issues the next database ope=
ra-
tion after one of those events).

In this way, the application does not have to treat these databa=
ses
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/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: undefined behaviour for sub-transactions?

am 15.11.2005 09:23:07 von Tyler MacDonald

Jochen Wiedmann wrote:
> 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.

Ok. If that's the only behaviour that can be depended on, then I
guess the best choice would be to make a wrapper around the database handle
that keeps track of the transaction status.

- Tyler

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org