Hi.

On Sun 2003-03-09 at 11:34:33 -0500, [EMAIL PROTECTED] wrote:
> From what I understand, "transactions" are a kind of protection that 
> prevents certain commands from executing if certain other conditions 
> haven't been met.

Not completely. They can do much more.

Another way to look at transactions is to think about them as a
possibility to execute several commands with the advantages (and
guarantees) of a single statement, that includes as main points:

 - all or none of the statements are submitted
   (if an error occurs, all statements are rolled back)
 - other threads can only see the effects of any of the statements,
   when the transaction is committed.

> And this is particularly important for ecommerce, among other
> things. Do I more or less have that right?

What is important for ecommerce are the ACID criteria (that are
guarantees: Atomicity, Consistency, Integrity, Durability - you may
want to look that term up), which require transactions to be
implemented.

Some people use the terms "transactions" in a wrong way by implying
that an RDBMS with transaction support automatically complies with the
ACID criteria, which is wrong. It just happens that most RDBMS which
support the one also comply to the other.


The most abused example is that a bank that wants to transfer money
from one account to another. To update the balances you would do
something like:

  UPDATE account SET balance=balance-100 WHERE id=2
  UPDATE account SET balance=balance+100 WHERE id=1

Without transactions it may happen that you end up with changing only
one of the two accounts. And there are a lot of possibilities why this
could happen (power outage, error in the update, network problems,
whatever). Some of them can be easily checked and worked-around in
application code, some of them can only be handled by changing the
database design and application logic a lot to accomodate the risks.

> My main question, tho', is: Does the latest version of MySQL
> available in production mode, not a beta or less, have this
> transactions capability yet?

MySQL 3.23 is declared stable since Jan 2001, i.e. more than two
years, and had transactions support even longer.

HTH,

        Benjamin.

-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to