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 Oracle as the DB. The only Identity Method supported for my Entities is Sequence so that is the one I am using. I have the following code which adds to my entity:
for (int i = 0; i < numberOfDays+1; i++) It works well about 80% of the time. Many times though I get an exception when I add the calendarEvent. The exception is that this entity already exists. When I check the Id of the calendarEvent I am trying to add I see that it is an id of an existing record. I actually debugged it and the sequence went something like that: 508,509,510,511,512,513,514,508....so the 508 got repeated and so is the 510 and 511.
Please help me out with this issue since this is a demo for a customer and it will look really bad if it randomly happens during the presentation.
Thanks Susan |
|
|
Hello Susan, We will take a look at this. It would be useful if you could do a couple of test runs and tell us the *exact* sequences of values that were generated. (We are interested in this because it will be useful to know whether the repeats happen after a particular number of iterations.) It would also be useful if you could try increasing the IdentityBlockSize on the LightSpeedContext, maybe to 20, and repeat the test. If this reduces the frequency of the error, you might want to consider temporarily setting IdentityBlockSize to a relatively large number such as 100 or 200. Finally, can you tell us what your application's threading model is, e.g. are you in a Web application where several threads may be running at the same time, or a WinForms or console application where all the activity is happening on a single thread? Thanks for letting us know about the problem and for your help in resolving it! |
|
|
Hello Ivan,
Thanks for the quick reply. You are right, when I tracked down the numbers it turns out that say I have the IdentityBlockSize set to 10 - the duplicated appear at the 10th entry(sometimes the 9th) I increased it to 15 and then the duplicates started to happen at the 15th entry and so on. So I will have the sequences generate consequtive numbers up until the 15th entry and then it starts from the first number so for example I would have 500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,..and then I get 500 again The application I have is a web app and it's relatively small.For now I increased the IdentityBlockSize to 200 and that should be good for the demo. Thanks again Susan
|
|
|
Thanks Susan, that's great info and will definitely help us to track down the problem. I'll let you know when we have a fix for you. |
|
|
Hello Susan, Just to update you on this, we have been able to reproduce the duplicate values problem only when the LightSpeed IdentityBlockSize is greater than the sequence INCREMENT BY value. When this is the case, we see the exception on the (IdentityBlockSize + 1)th save. After this, identities begin again at the starting value plus the INCREMENT BY value. The behaviour you are seeing would therefore be consistent with the sequence having an INCREMENT BY value of 0 or 1. Can you check your database and let us know what the INCREMENT BY value of the LightSpeed sequence is? Thanks! |
|