You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by GitBox <gi...@apache.org> on 2020/02/12 22:23:45 UTC
[GitHub] [cayenne] johnthuss opened a new pull request #413: CAY-2650
Support using generated primary keys along with batch inserts
johnthuss opened a new pull request #413: CAY-2650 Support using generated primary keys along with batch inserts
URL: https://github.com/apache/cayenne/pull/413
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] stariy95 commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
stariy95 commented on issue #413: CAY-2650 Support using generated primary keys along with batch inserts
URL: https://github.com/apache/cayenne/pull/413#issuecomment-588238345
FYI I've pushed a fix for the postgres build, I think it was a change in a Postgres docker image.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] andrus commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
andrus commented on issue #413: CAY-2650 Support using generated primary keys along with batch inserts
URL: https://github.com/apache/cayenne/pull/413#issuecomment-586836415
So the fact that this is supported only by some DBs means we need a way to choose the strategy based on the adapter config.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] stariy95 commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
stariy95 commented on issue #413: CAY-2650 Support using generated primary keys along with batch inserts
URL: https://github.com/apache/cayenne/pull/413#issuecomment-586144526
Hi @johnthuss,
It's really great you implemented this. IIRC someone mentioned having problems without PK generation batching.
Just in case, have you seen that Derby and SQLServer tests are failing?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] johnthuss commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
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-587523004
The postgres build is failing to start up due to a build server issue.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] johnthuss commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
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-588403155
Thanks. It build successfully now (I guess without the docker change).
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] asfgit merged pull request #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
asfgit merged pull request #413: CAY-2650 Support using generated primary keys along with batch inserts
URL: https://github.com/apache/cayenne/pull/413
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] johnthuss commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] johnthuss commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
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-586376879
SQL Server does not support this either.
https://github.com/microsoft/mssql-jdbc/issues/245
They say the spec makes it optional.
> On JDBC specification it says
> > It is implementation-defined as to whether getGeneratedKeys will return generated values after invoking the executeBatch method.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [cayenne] johnthuss commented on issue #413: CAY-2650 Support using
generated primary keys along with batch inserts
Posted by GitBox <gi...@apache.org>.
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-586328094
Yeah, I was the one who mentioned the problem. :-)
I was planning to check back to see the test results, but hadn't yet. So thanks for the heads up.
I can test derby on my own machine, but I don't have a docker setup for SQLServer. Is anyone else able to address that DB?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services