![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
| Messages 1 to 3 of 3 total |
| Tue, Aug 12 2025 11:20 AM | Permanent Link |
Hershcu Sorin | Hello,
In my program, I have a table with an AutoIncrement field. When I run the program, I set the table to BeginCachedUpdates mode. After appending a few records to the table, I use the ApplyCachedUpdates command to save the records. At this stage, the program raises an error indicating that the Primary Key is violated due to a duplicate key value of 1. I don't change the value of the Id field What could be the problem? |
| Thu, Aug 14 2025 6:50 AM | Permanent Link |
Heiko Knuettel | Hi,
Just guessing - I'm not sure since I don't use CachedUpdates or AutoInc fields - but this might be a limitation. AutoIc fields increment once the row is written, and CachedUpdates prevent the rows from being written until later. You could get the current AutoInc value before starting CachedUpdates and increment yourself. And hope that 3 other users don't do the same thing at the same time. Heiko |
| Fri, Aug 15 2025 5:51 AM | Permanent Link |
Adam Brett Orixa Systems | Hi Hershcu Sorin,
I agree with the other poster that this may be a limitation of EDB. Note that you could use a GUID as your primary key instead, or reference and external function that returns an Integer. If the function is triggered after-insert I am pretty sure it will work correctly even with the table in cached mode. |
This web page was last updated on Saturday, May 9, 2026 at 08:16 AM | Privacy Policy © 2026 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

