Re: mysql and transactions
| From: | Tomas V.V.Cox | Date: | Fri, 27 Jul 2001 02:50:28 +0000 |
| Subject: | Re: mysql and transactions | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1084@lists.php.net to get a copy of this message | ||
Oleg Rekutin wrote:
>
> On Thursday, July 26, 2001, 10:14:52 PM, in message "[PEAR-DEV] mysql
> and transactions", Tomas wrote:
>
> TVVC> Oleg Rekutin wrote:
> >>
> >> Yes. Note, however, that MySQL has only two table types that
> >> support transactions: BDB and InnoDB. The rest are
> >> non-transaction-safe tables. While I see no big problem with
> >> imlpementing somethign like DB_mysql::commit () as
> >> $this->query("COMMIT"), I wonder what should the proper action be
> >> in case of non-transaction-safe tables, which are probably the
> >> kinds of tables in use in 90% of MySQL installations today (blind
> >> guess, but you get the idea).
>
> TVVC> The mysql extension (as all others) has the feature array with the
> TVVC> transactions field. To avoid problems the guys who knows that their
> TVVC> tables support transactions will want to set this param to true to be
> TVVC> able to use transaction methods. :-?
>
> Isn't that too much of a hack? The DB reports that it can't do
> transactions and suddenly the programmer says: "well, I'm gonna make
> you do them by changing your capabilities flags! There, you can do
> transactions now."
>
Yes this is the idea :) I think that: if native mysql doesn't support
transactions, we don't want to give methods to developers that won't
work as expected (as you told with the rollback problem) and it's
probably difficult (imposible?) to check if the table supports or not
transactions, the only solution I saw was to change this flag. If your
MySQL do support transactions: why not change the flag?
Any way was only an idea.
Tomas V.V.Cox