"No, with the default transaction isolation level, REPEATABLE READ, that's how it is supposed to work. You've started a transaction in Window B, so Window B is immune to changes made in Window A until you finish the transaction in Window B. See the manual for details

http://dev.mysql.com/doc/mysql/en/innodb-consistent-read.html";

I haven't explicitly started any transactions in Window B - it's select-only 
(with autocommit set to 0). Are you
saying that even though transactions have happend and been committed in Window 
A, I won't be able to see those
transactions in Window B?

The relevant part of the documentation in the link you sent is,

"The query see[s] the changes made by exactly those transactions that committed 
before that point of time, and
no changes made by later or uncommitted transactions. The exception to this 
rule is that the query sees the
changes made by the transaction itself that issues the query."

In otherwords, if you start a query (and it's a long running query), you won't 
see the results of any data
committed by another session during the running of that query. Fine. That's 
expected.

But if I am doing only queries (no transactions) via a connection, and no query 
is running when I commit data in
another session, then the query-window should see the results of those changes.

I suspect that the mysql client is implicitly starting a transaction when you do a 
"set autocommit=0". Thus, any
changes made by any other sessions won't be visible till you do a commit or 
rollback. Each time a commit or
rollback is issued in the non-auto-commit session, you can see data changed by 
other sessions.

Regardless, this is not a repeatable-read issue. I think it's a mysql client 
issue, and the fact that the client
is creating transactions for you in the background.

This is not how the Oracle client works - you are always in non-auto-commit 
mode (and I'd love to figure out
how to set that - autocommit is so dangerous), and until you actually start a 
transaction with an update, insert,
delete or select-for-update, no transaction is started, and you can see the 
changes made by other sessions once
they've been committed (I tested SQL*Plus on Oracle 8i to make sure).

David


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to