rzo1 opened a new pull request, #276:
URL: https://github.com/apache/openjpa/pull/276

   https://issues.apache.org/jira/browse/OPENJPA-3047 (part of OPENJPA-3028)
   
   A bulk UPDATE that sets a column of a joined superclass table or of a 
secondary table failed on Derby, H2 and the other databases that cannot update 
joined tables in one statement, e.g. `UPDATE Engine e SET e.quantity = ...` 
gave "'QUANTITY' is not a column in table 'ENGINE'". Setting only a subclass 
column of a joined entity with `@Version` failed as well, since the version 
column is in the root table.
   
   Such an update now selects the primary keys of the matching rows once and 
runs one UPDATE per affected table restricted to those keys (chunked by 
`inClauseLimit`, composite keys supported). A SET value that reads a column of 
another table falls back to the in-memory update. MySQL and MariaDB use the 
same path for these updates, because their joined UPDATE counted the changed 
rows of every table instead of the entities. Updates of a single table generate 
the same SQL as before.
   
   New `TestBulkUpdateMultipleTables`. The full openjpa-persistence-jdbc suite 
passes on Derby and H2, the bulk tests also on MySQL 9 and MariaDB.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to