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, I seem to be having a slight problem with LightSpeed (I'm a relatively new user) I am using PostgreSQL and have created a sequence public."LightSpeed" I have set the LightSpeedContext.IdentityMethod = IdentityMethod.Sequence; I am receving exceptions from lightspeed informing me that it is trying to violate the primary key constraint- the Sql it is executing is trying to insert a duplicate of a previously inserted (by lightspeed, using the sequennce) value. The sequence in the database has the correct current value, lightspeed is (for some reason) attempting to insert a value below this.
|
|
|
Hi Peter, Does the INCREMENT BY of your sequence match the LightSpeed IdentityBlockSize value (default 10)? Cheers, Andrew. |
|
|
Hi Andrew, No, its currently set to 1 I didnt realise this needed to match the block size? What about records that are not inserted through lightspeed? this would mean that you have a step of 10 (for example) between these records? Regards, |
|
|
Peter, Feel free to adjust the block size as you see fit. The larger the number the fewer database calls LightSpeed makes allocating id's but the larger the potential "holes" are in the id space. Alternatively, you could use the Identity Column strategy. Cheers, Andrew. |
|
|
Hi Andrew, Thank you for the quick response. Since we have a lot of records inserted by another process, aswell as through lightspeed i think we are going to try a BlockSize of 1. Peter |
|