From: Alban Hertroys [mailto:alban@xxxxxxxxxxxxxxxxx] >Arturo Perez wrote: >> In any case, at this point in time it's looking like Cayenne doesn't honor >> the rules of the sequence. It appears to (and is documented as) internally >> incrementing rather than fetching the sequence for each insert. > >I have no experience with Cayenne, but reading >http://cwiki.apache.org/CAYDOC/primary-key-generation.html it seems >possible to use database sequences instead of Cayenne-generated ones: > >"... Generation mechanism depends on the DbAdapter used and can be >customized by users by subclassing one of the included adapters." > Yes. I think I am being bitten by a desire to minimize changes required when migrating from MySQL to PostgreSQL. Contrary to my belief, it appears that the pgSQL schema creation script was not created by Cayenne configured to work with pgSQL but rather was based on the script Cayenne used to create the MySQL database. Looks like I will be uncovering nits as we go for a bit yet. I did modify the sequences to increment by 20 as required by Cayenne. Hopefully, this particular issue will be laid to rest by that. thanks all, -arturo