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
|
Hi, Using sequence as a key provider in Oracle I am getting a unique constrain violation on the primary key/"Id" field of my entity. When the number of entities being inserted exceeds the "INCREMENT_BY" property of the sequence in Oracle, Oracle throws the exceptions mentioned above. For example, even thought I've specified the 'IdentityBlockSize' for my context to 48, when I try to insert 48 new entities and the "INCREMENTBY" property of my Oracle sequence is 10, I get the exception. If I increase the "INCREMENTBY" value to 50, the problem is gone. |
|
|
Yes this is correct. We dont have any awareness of the increment by that the sequence was set up with, we simply use that sequence as a means to get an identity value and use that in conjunction with the identity block size you have configured to determine the range of assignable identity values we can use before we need to fetch a new value from the sequence. The assumption we take is that you are making sure that the block size is less than or equal to the sequence increment to ensure there are no collisions generated. So if your identityBlockSize is 48 then you should ensure that your increment is set to >= 48.
|
|