I had some similar problem with Oracle. It had to do with cached sequence numbers. The solution was to specify, in the modeler, Cached PK Size as 1.
Hope this helps. Josep -----Mensaje original----- De: bobsponge [mailto:[EMAIL PROTECTED] Enviado el: jueves, 10 de julio de 2008 15:37 Para: user@cayenne.apache.org Asunto: Autogenerated keys issues Hello, I'm using cayenne v2.0.4 with h2 as database engine. All table indexes are auto-generated with a auto_pk_support table. Table Indexes generation usually works but some times I get an error like this org.apache.cayenne.CayenneRuntimeException: [v.2.0.4 October 12 2007] Commit Exception, org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: PRIMARY_KEY_36 ON PUBLIC.TABLETEST(ID) [23001-74] It seems the ID generation fails with no reason at all. I usually get this problem in the same table when several insertions are performed very quickly. All changes in the datacontext are committed every time a new object is created. ¿Is there any problem with h2 database and auto_pk_support? Thank you -- View this message in context: http://www.nabble.com/Autogenerated-keys-issues-tp18382943p18382943.html Sent from the Cayenne - User mailing list archive at Nabble.com.