Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2
    • Fix Version/s: 2.0.0-M2
    • Component/s: query
    • Labels:
      None

      Description

      Implement support for PU properties and hints passed in persistence.xml and/or the Map parameter of createEntityManagerFactory().
      Section 8.1.3.1 of the JPA 2.0 Public Draft #1.
      This work item is to add junit coverage on Query for the following new PU properties:
      javax.persistence.lock.timeout
      javax.persistence.query.timeout
      Supplying them in a Map to createEMF should override any values supplied in persistence.xml.

      1. OPENJPA-972.patch
        18 kB
        Donald Woods

        Issue Links

          Activity

          Donald Woods created issue -
          Donald Woods made changes -
          Field Original Value New Value
          Fix Version/s 2.0.0 [ 12313483 ]
          Affects Version/s 2.0.0 [ 12313483 ]
          Description Implement support for PU properties and hints passed in persistence.xml and/or the Map parameter of createEntityManagerFactory().
          Section 8.1.3.1 of the JPA 2.0 Public Draft #1.
          Component/s kernel [ 12311302 ]
          Donald Woods made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Donald Woods made changes -
          Description Implement support for PU properties and hints passed in persistence.xml and/or the Map parameter of createEntityManagerFactory().
          Section 8.1.3.1 of the JPA 2.0 Public Draft #1.
          Implement support for PU properties and hints passed in persistence.xml and/or the Map parameter of createEntityManagerFactory().
          Section 8.1.3.1 of the JPA 2.0 Public Draft #1.
          This work item is to add junit coverage on Query for the following new PU properties:
             javax.persistence.lock.timeout
             javax.persistence.query.timeout
          Supplying them in a Map to createEMF should override any values supplied in persistence.xml.
          Hide
          Donald Woods added a comment -

          Based on chatting with Jeremy, Pinaki and Albert today, I thought I would document the following code behavior as part of this JIRA -

          The code currently does not pass the properties supplied on the PU in persistence.xml or via a properties Map to createEMF down as hints, but only as config settings in FetchPlan. This is the expected and agreed upon behavior for OpenJPA 2.0.

          The spec says that PU or Map provided properties to the EMF will be used as defaults and that Query.setHint() can be used to override, but there is no requirement for getHints() to return these default values.

          Show
          Donald Woods added a comment - Based on chatting with Jeremy, Pinaki and Albert today, I thought I would document the following code behavior as part of this JIRA - The code currently does not pass the properties supplied on the PU in persistence.xml or via a properties Map to createEMF down as hints, but only as config settings in FetchPlan. This is the expected and agreed upon behavior for OpenJPA 2.0. The spec says that PU or Map provided properties to the EMF will be used as defaults and that Query.setHint() can be used to override, but there is no requirement for getHints() to return these default values.
          Hide
          Donald Woods added a comment -

          Patch that adds 2 files to test the following JPA 2.0 Persistence Unit Properties scenarios:
          1) persistence.xml provided properties
          1a) No PU properties provided is same as no timeout (JDBC defined)
          1b) PU provided properties translated into config
          2) Map of properties provided to createEMF()
          2a) EMF props can be set when no PU props provided
          2b) EMF props override PU set properties in config
          3) QueryHints override default values from PU or EMF (2b)
          4) Query.setHint()
          4a) can override default values from PU or EMF (2a)
          4b) can override QueryHints (3)

          Also modifies PersistenceProductDerivation to add a comment to explain where 3 elements (including properties) are handled in the code.

          Show
          Donald Woods added a comment - Patch that adds 2 files to test the following JPA 2.0 Persistence Unit Properties scenarios: 1) persistence.xml provided properties 1a) No PU properties provided is same as no timeout (JDBC defined) 1b) PU provided properties translated into config 2) Map of properties provided to createEMF() 2a) EMF props can be set when no PU props provided 2b) EMF props override PU set properties in config 3) QueryHints override default values from PU or EMF (2b) 4) Query.setHint() 4a) can override default values from PU or EMF (2a) 4b) can override QueryHints (3) Also modifies PersistenceProductDerivation to add a comment to explain where 3 elements (including properties) are handled in the code.
          Donald Woods made changes -
          Attachment OPENJPA-972.patch [ 12402416 ]
          Hide
          Donald Woods added a comment -

          Jeremy, can you take a look at committing this, as I'll need these changes in trunk before I can post a patch for OPENJPA-963. Thanks.

          Show
          Donald Woods added a comment - Jeremy, can you take a look at committing this, as I'll need these changes in trunk before I can post a patch for OPENJPA-963 . Thanks.
          Donald Woods made changes -
          Assignee Donald Woods [ drwoods ] Jeremy Bauer [ techhusky ]
          Component/s query [ 12311309 ]
          Component/s kernel [ 12311302 ]
          Donald Woods made changes -
          Link This issue depends on OPENJPA-878 [ OPENJPA-878 ]
          Donald Woods made changes -
          Link This issue blocks OPENJPA-963 [ OPENJPA-963 ]
          Hide
          Jeremy Bauer added a comment -

          Committed OPENJPA-972.patch dated 2009-03-17 01:41 PM under revisions 755614 755615 for Donald.

          Show
          Jeremy Bauer added a comment - Committed OPENJPA-972 .patch dated 2009-03-17 01:41 PM under revisions 755614 755615 for Donald.
          Jeremy Bauer made changes -
          Assignee Jeremy Bauer [ techhusky ] Donald Woods [ drwoods ]
          Hide
          Donald Woods added a comment -

          Jeremy, thanks for committing the patch.

          Show
          Donald Woods added a comment - Jeremy, thanks for committing the patch.
          Donald Woods made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Link This issue depends on OPENJPA-878 [ OPENJPA-878 ]
          Gavin made changes -
          Link This issue depends upon OPENJPA-878 [ OPENJPA-878 ]
          Gavin made changes -
          Link This issue blocks OPENJPA-963 [ OPENJPA-963 ]
          Gavin made changes -
          Link This issue is depended upon by OPENJPA-963 [ OPENJPA-963 ]

            People

            • Assignee:
              Donald Woods
              Reporter:
              Donald Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development