Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
10.3.2.1
-
None
-
N/A
-
Normal
-
High Value Fix, Repro attached
-
Deviation from standard
Description
Currently support for autogeneration key retrieval in JDBC driver (java.sql.Statement) relies on IDENTITY_VAL_LOCAL function, which means that for multi-row INSERT... VALUES statements as well as for INSERT...AS SELECT statement wrong result are returned (key generated of last executed single-row INSERT...VALUES statement or NULL otherwise). While this functionality is documented in the Reference description of IDENTITY_VAL_LOCAL it is not so clearly documented in "autogenerated keys" subchapter of JDBC 3.0 Features (the only vague hint is "Calling ResultSet.getMetaData on the ResultSet object returned by getGeneratedKeys produces a ResultSetMetaData object that is similar to that returned by IDENTITY_VAL_LOCAL.").
Moreover, as far as I understant it diverge from JDBC specification. IMHO or this functionality shal lbe implemented completely, or exception shall be thrown if for given statement functionality is not supported (e.g. "Feature not supported").
Attachments
Attachments
Issue Links
- is duplicated by
-
DERBY-6994 Only last generated key in batch update is returned
- Resolved
- is related to
-
DERBY-6934 Lock conflicts between Statement.getGeneratedKeys() and sequence-generator-based identity columns
- Open
-
DERBY-6952 Regression on Statement.getGeneratedKeys() on UPDATE statements
- Open
-
DERBY-6389 Update adminguide's list of differences between client and embedded
- Closed
-
DERBY-5823 Multi-row insert fails on table without generated keys with RETURN_GENERATED_KEYS
- Closed
- relates to
-
DERBY-6849 Statement.RETURN_GENERATED_KEYS returns a 1 row result set even if there are no auto-generated fields
- Open
-
DERBY-6948 INSERT .. SELECT produces NULL for getGeneratedKeys()
- Open