johnthuss commented on issue #413: CAY-2650 Support using generated primary keys along with batch inserts URL: https://github.com/apache/cayenne/pull/413#issuecomment-586364657 It seems Derby does not support multi-row generated keys. From https://issues.apache.org/jira/browse/DERBY-3609 > Statement.getGeneratedKeys() is partially implemented, and behaves very similar to IDENTITY_VAL_LOCAL() since it will only return a meaningful result when an single row insert is done with INSERT...VALUES. > > The correct behavior (if DatabaseMetaData.supportsGetGeneratedKeys() returns true) is defined in the JDBC3 spec, section 13.6 (Retrieving Auto Generated Keys). > > It requires support for multirow inserts, namely > "In some cases, such as in an insert select statement, more than one key may be > returned. The ResultSet object returned by getGeneratedKeys will contain a > row for each key that a statement generated. If no keys are generated, an empty > result set will be returned." So the driver is sort of lying when it says that it supports generated keys. Should I introduce a new flag into JdbcAdapter like "supportsGeneratedKeysInBatchInserts"?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services