Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
3.1
-
None
Description
I've seen this myself, but it was also raised on the mailing list today. The system has a sequence with an "increment_by" value of 1. This generates an increment of 1 for each query to get the next value.
Cayenne on the other hand has a default cache of 20 defined at JdbcPkGenerator#DEFAULT_PK_CACHE_SIZE. This creates a problem because Cayenne assigns PK's 1..20 for its use, but the sequence is only incremented by 1 in the database.
Maybe look at generating corrected DDL or defaulting to a cache of 1 for the case where primary keys are being database generated.