OpenJPA
  1. OpenJPA
  2. OPENJPA-1944

Extra select statements executed when version column is null.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2, 2.1.0
    • Fix Version/s: 2.1.1, 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      This problem was originally reported on the users mailing list by Diego Cattelan. Link to the thread :http://openjpa.208410.n2.nabble.com/N-query-problem-with-Version-td6027619.html

      The problem occurs if a null value is returned for an entity's version field. In this case OpenJPA will issue a second select statement to re-fetch the version, potentially resulting in a lot of repetitive SQL statements.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3d 8h 1m 1 Michael Dick 21/Feb/11 22:38
        In Progress In Progress Resolved Resolved
        3h 28m 1 Michael Dick 22/Feb/11 02:06
        Resolved Resolved Reopened Reopened
        28d 12h 30m 1 Rick Curtis 22/Mar/11 14:37
        Reopened Reopened Resolved Resolved
        6h 30m 1 Rick Curtis 22/Mar/11 21:07
        Resolved Resolved Closed Closed
        316d 19h 59m 1 Albert Lee 02/Feb/12 17:07
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Albert Lee added a comment -

        Close issue in preparation for 2.2.0 release.

        Show
        Albert Lee added a comment - Close issue in preparation for 2.2.0 release.
        Rick Curtis made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Rick Curtis added a comment -

        Checked changes into 2.1.x and trunk

        Show
        Rick Curtis added a comment - Checked changes into 2.1.x and trunk
        Rick Curtis made changes -
        Fix Version/s 2.1.1 [ 12316191 ]
        Hide
        Rick Curtis added a comment -

        The previous change that Mike committed causes an OLE if an Entity with a null version is updated. The change I'm going to commit shortly here reverts the previous commit and looks to see if a null version field has been loaded before going back to the DB.

        Show
        Rick Curtis added a comment - The previous change that Mike committed causes an OLE if an Entity with a null version is updated. The change I'm going to commit shortly here reverts the previous commit and looks to see if a null version field has been loaded before going back to the DB.
        Rick Curtis made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Rick Curtis added a comment -

        Reopening this JIRA as it needs a bit more work.

        Show
        Rick Curtis added a comment - Reopening this JIRA as it needs a bit more work.
        Rick Curtis made changes -
        Assignee Michael Dick [ mikedd ] Rick Curtis [ curtisr7 ]
        Michael Dick made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michael Dick made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Michael Dick created issue -

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Michael Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development