List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:November 13 2007 5:24pm
Subject:Re: Transactions and locking
View as plain text  
Yves Goergen wrote:
> (Damn I hate those lists that don't come with a Reply-To to the list!
> Resending...)
> 
> On 13.11.2007 17:39 CE(S)T, Baron Schwartz wrote:
>> Yves Goergen wrote:
>>> Row level locking can only lock rows that exist. Creating new rows (that
>>> would have an influence on my MAX value) are still possible and thus row
>>> level locking is not what I need. I really need locking an entire table
>>> for every other read or write access.
>> InnoDB can also lock the gap, which will prevent new rows that would 
>> have been returned by the SELECT.  The manual has more info on this in 
>> the section on consistent reads in InnoDB.  FOR UPDATE will do what you 
>> need.
> 
> I've read about that "gap" but it sounded like "the place [somewhere]
> before a record where one could insert a new record into". Not sure what
> that should be. I'm not aware of the InnoDB internals. I know that
> usually (?) when a new record is stored, it is written to where is
> enough space for it, linked from a free pointer index. If one is locked,
> another one might be used. Order doesn't matter in relational databases.

Are you thinking that your theoretical knowledge of relational databases 
must hold the answer to your questions about MySQL?

:-)

I suggest you read the entire manual section on InnoDB and experiment. 
Set aside a day for it; there's a lot to learn there.

Baron
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