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, When LightSpeed performs Guid ID generation, does it use a method similar to Guid.Comb, or is a Guid simply randomly generated? I want to go with Guids as my ID's, but the performance of Comb Guids gives a siginificant advantage in SQL Server at least. If necessary, is there a proper way to override the Guid generation? Thx, Eric |
|
|
Hi Eric, I've added GuidComb to our list of available identity generation strategies. It will be available from tonight's nightly build. Cheers, Andrew. |
|
|
Awesome, thanks! |
|
|
Hi Andrew, I actually haven't yet seen this added, or at least it doesn't appear in the designer. Am I missing something? |
|
|
OK, I do see that it is available in the enumeration. The issue is that if I change this in the code file and then save something else in the designer that it overwrites the code file with whatever happens to be set in the designer. I tried to update the underlying designer XML to put in Guid.Comb, but this didn't appear to work. |
|
|
What I have done for the time being is moved the "Table" attribute out to a partial class and define the ID field and generator in the partial class. I just removed these attributes from the generated classes and designer def. I believe this will solve the problem, but would probably be good to add the enum to the designer anyway. |
|
|
Hello Eric, Designer support for GuidComb will be in the next nightly build (available after about 1800 GMT). Sorry about the delay on this. By the way, depending on your database design, you may not need this anyway. Specifying the identity method at entity level in the designer is the exception rather than the rule. In most models, all the entity types use the same identity method, so you can specify this on the LightSpeedContext (directly or in the configuration file). So if all your tables use GuidComb identities then you should leave the identity method on each entity in the designer as Default, and set the identity method to GuidComb at the LightSpeedContext level. (Of course if some tables use GuidComb and others use a different identity strategy then of course you are quite right to set it at an entity level!) |
|