openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ritika Maheshwari" <>
Subject Re: [jira] Commented: (OPENJPA-182) db2 update lock syntax WITH <isolation> USE AND KEEP UPDATE LOCKS
Date Wed, 18 Apr 2007 16:56:43 GMT
1. OK I think I will open a new issue for the bug
2. I will redo the formatting
3.To be able to use DBDictionary method we will have to change the signature
of the

toSelect(SQLBuffer selects, JDBCFetchConfiguration fetch,SQLBuffer from,
SQLBuffer where, SQLBuffer group,SQLBuffer having, SQLBuffer
*boolean* forUpdate, *long* start, *long* end)

to include a boolean flag subselect which will be computed in the

SQLBuffer toSelect(Select sel, *boolean* forUpdate,JDBCFetchConfiguration

since we have the handle to the Select here.This needs to be done only for
DB2 because  only in case of DB2 even if forUpdate is false( which is set to
false correctly for subselects by SQLBuffer.resolveSubselects())  we need to
append a FOR READ ONLY clause except in case of subselects.In other
databases if forUpdate is false we do not append any update or FOR READ ONLY
CLAUSE. So this situaton is unique to db2.

So Essentially we need to pass this subselect flag to getForUpdateClause
method.I am not sure how would we do that without overriding the method in
DB2Dictionary or chnaging the signatures in DBDictionary which would affect
many other files

On 4/17/07, Patrick Linskey (JIRA) <> wrote:
>    [
> Patrick Linskey commented on OPENJPA-182:
> -----------------------------------------
> Some comments:
> 1. I don't think that we should be doing work on resolved issues. So, this
> should be re-opened, or (preferably) a new issue should be opened for this
> new bug.
> 2. The patch you attached does not use OpenJPA-style formatting. We don't
> have a style guide spelled out as well as we probably should, but we always
> put spaces after commas, we indent 4 spaces on continuation lines, and we
> put a space between an 'if' and the open paren.
> 3. It's a shame to have to do all this code duplication between
> DBDictionary and DB2Dictionary. To what extent can we refactor
> DBDictionary's methods to make this concept work out better for
> DB2Dictionary?
> > db2 update lock syntax  WITH <isolation> USE AND KEEP UPDATE LOCKS
> > ------------------------------------------------------------------
> >
> >                 Key: OPENJPA-182
> >                 URL:
> >             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
> > 2.  when using DB2/400 on iSeries machines, the syntax is WITH RS USE
> 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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message