This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I am using lightspeed key table generation with sql server for primary key generation. I am getting primary key violations randomly when inserting new entities. It looks like the following queries are used to get the key blocks when inserting. From the looks of it these two statements are not issued in a transaction though. Couldn't this cause two subsequent reads to the key table to get the same batch as the updlock only lasts for the duration of the select. The update appears to happen after the select when the new next id value is calculated. This appears to allow for two identical sets of id blocks to be retrieved before the new nextid can be set. |
|
|
Hi I got this behavior when running my database tests on a newly created database. If I run those tests in isolation, the behavior doesn't manifest itself. Werner |
|
|
Hi guys, The KeyTable id reservation does occur within a transaction, we spawn off a separate database transaction for this to occur in isolated from the ambient transaction scope. Do you have a way of reproducing this behavior, if not I might look at doing some specific concurrency tests here and see if I can trigger any issues.
|
|
|
Hi Jeremy My environment is .NET 4.0 and MySQL 5.5.9 with MySQL Connector/NET 6.4.4. I'm able to reproduce the issue in my environment but unfortunately I can't send you the solution. I'll see if I can get some time to isolate it with a similar object model, but I can't promise anything. Werner |
|
|
Thanks - that would certainly be useful if you are able to send something though - Ill continue investigating here in the meantime.
|
|