[ https://issues.apache.org/jira/browse/OPENJPA-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ritika Maheshwari updated OPENJPA-182: -------------------------------------- Attachment: JIRA182-subselect.patch we just discovered that there is a problem with this fix.The problem is that the FOR READ ONLY flag is getting generated for subselects as well. Basically for DB2 if forUpdate was false we append FOR READ ONLY we need another check to see that it is not a subselect.To me it appears that in the toSelect method when SelectImpl is passed we check that the parent is null or not to figure out that it is a subselect and then pass another flag subselect to the getForUdateClause method where we say if(!forUpdate && !subselect) forUpdateString.append(forReadOnlyClause) to achieve this we would probably have to override the toSelect methods in DB2Dictionary again unless there is a better way. I am attaching a patch to specify the changes > db2 update lock syntax WITH <isolation> USE AND KEEP UPDATE LOCKS > ------------------------------------------------------------------ > > Key: OPENJPA-182 > URL: https://issues.apache.org/jira/browse/OPENJPA-182 > Project: OpenJPA > Issue Type: New Feature > Components: jdbc > Environment: db2 database driver for zOS, AS400, Unix, Windows, Linux > Reporter: David Wisneski > Fix For: 0.9.7 > > Attachments: JIRA182-subselect.patch, OPENJPA-182.patch, > OPENJPA-182.patch, openJPA182.patch, openjpa182TestCase.jar > > > A while back we changed the syntax of update locking from FOR UPDATE OF to > WITH RS USE AND KEEP UPDATE LOCKS. Additional changes are required because > 1. if isolation=serializable is configured, then the syntax should be WITH > RR USE AND KEEP UDPATE LOCKS > 2. when using DB2/400 on iSeries machines, the syntax is WITH RS USE AND > KEEP EXCLUSIVE LOCKS or WITH RR USE AND KEEP EXCLUSIVE LOCKS because DB2/400 > only supports read or exclusive locks. > 3. DB2 supports both a FETCH FIRST ROWS and update LOCKS clauses. > So we change supportsLockingWithSelectRange = true in the > AbstractDB2Dictionary class and change the DB2Dictionary to append the > correct LOCKS syntax depending on vendor, release and isolation level. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.