List:General Discussion« Previous MessageNext Message »
From:Yves Goergen Date:November 13 2007 7:46pm
Subject:Re: Transactions and locking
View as plain text  
On 13.11.2007 19:19 CE(S)T, Perrin Harkins wrote:
> "You can use next-key locking to implement a uniqueness check in your
> application: (...)
> http://dev.mysql.com/doc/refman/5.0/en/innodb-next-key-locking.html

This doesn't help my problem either. It may lock new INSERTs to the
table, but it won't lock SELECTs so any other concurrent user can still
find its own (same) MAX(id) value and then do an insert. Or any other
process can still check for uniqueness and then fail with its insert.
The insert of the first process may succeed guaranteed, but the second
will fail at a point where it should not. (Actually, it should never
fail when I found a new id value / found that my new value is unique.)

I have tested the SELECT ... FOR UPDATE and the LOCK TABLES with
autocommit = 0 thing. Both don't lock anything (at least not for reading
by others which is what I need). May I now conclude that exclusive full
table locking is not possible with InnoDB? Or is there another way that
I don't know yet?

-- 
Yves Goergen "LonelyPixel" <nospam.list@stripped>
Visit my web laboratory at http://beta.unclassified.de
Thread
Transactions and lockingYves Goergen12 Nov
  • Re: Transactions and lockingMartijn Tonies12 Nov
  • Re: Transactions and lockingPerrin Harkins12 Nov
    • Re: Transactions and lockingYves Goergen12 Nov
      • Re: Transactions and lockingPerrin Harkins12 Nov
      • Re: Transactions and lockingYves Goergen12 Nov
        • Re: Transactions and lockingYves Goergen12 Nov
          • Re: Transactions and lockingPerrin Harkins12 Nov
            • Re: Transactions and lockingYves Goergen12 Nov
              • Re: Transactions and lockingPerrin Harkins13 Nov
                • Re: Transactions and lockingYves Goergen13 Nov
                  • mysqlhotcopyMalka Cymbalista13 Nov
                  • Re: Transactions and lockingBaron Schwartz13 Nov
                    • Re: Transactions and lockingmark addison13 Nov
                      • Re: Transactions and lockingYves Goergen13 Nov
                        • Re: Transactions and lockingBaron Schwartz13 Nov
                          • Re: Transactions and lockingYves Goergen13 Nov
                            • Re: Transactions and lockingBaron Schwartz13 Nov
                          • Re: Transactions and lockingPerrin Harkins13 Nov
                            • Re: Transactions and lockingYves Goergen13 Nov
                              • Re: Transactions and lockingBaron Schwartz13 Nov
                                • Re: Transactions and lockingYves Goergen13 Nov
                    • Re: Transactions and lockingYves Goergen13 Nov
                    • Re: Transactions and lockingYves Goergen13 Nov
                      • Re: Transactions and lockingBaron Schwartz13 Nov
                        • Re: Transactions and lockingYves Goergen13 Nov
                        • Re: Transactions and lockingYves Goergen13 Nov
                          • Re: Transactions and lockingPerrin Harkins13 Nov
  • Re: Transactions and lockingMartijn Tonies13 Nov
  • Re: Transactions and lockingMartijn Tonies14 Nov
    • Re: Transactions and lockingYves Goergen15 Nov
  • Re: Transactions and lockingMartijn Tonies15 Nov
Re: Transactions and lockingYves Goergen13 Nov
  • Re: Transactions and lockingPerrin Harkins13 Nov