Hi Stefan,

> Does the second shell actually perform those changes? In this case, I
assume
> it's got something to do with the isolation level / consistent read in
> InnoDB tables. "shell1" sees all its changes immediately, "shell2" (the
> application) has just a snapshot of the data at the time it performs the
> select.

Well, in fact "shell2" is just another mysql shell I opened. So the
following is the situation :

Application loops. "shell1" changes data. "shell2" (which is just another
mysql shell i opened) can see the changes.
The application still doesnt.

So, how can that be caused by the isolation level ? Even after issuing a
COMMIT in "shell1" (the shell that changes data)
theres nothing visible in the application.

>
> This should however only be true for the select the first time the
> application loops. But if it uses the same conn = mysql_init(NULL); (I am
> not a C programmer), it will keep the same isolation level, and thus, the
> same snapshot.

Well, does that mean that I have to commit that "dummy" transaction in the
application just to have the commited data of
the other sessions available ?  I call it "dummy" because this transaction
doesnt change any data, just SELECTS it.

Here I quote the innodb manual :
"If you are running with the default REPEATABLE READ isolation level, then
all consistent reads within the same transaction read the snapshot
established by the first such read in that transaction. You can get a
fresher snapshot for your queries by committing the current transaction and
after that issuing new queries"

This would explain the behaviour of the application but seems quite useless
to me as I think the task of an atomic operation
should be to have changes done or completely rolled back.

Or do I get something wrong ?

Thanks,
Heri




---------------------------------------------------------------------
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