OpenJPA
  1. OpenJPA
  2. OPENJPA-847

Retrieving database generated keys gets never enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2
    • Fix Version/s: 1.3.0, 2.0.0-M2
    • Component/s: jdbc
    • Labels:
      None

      Description

      Support for getting generated keys (OPENJPA-736) needs a bit of more work - DBDictionary.supportsGetGeneratedKeys is always false.

      1. OPENJPA-847.patch
        4 kB
        Milosz Tylenda

        Issue Links

          Activity

          Milosz Tylenda created issue -
          Milosz Tylenda made changes -
          Field Original Value New Value
          Link This issue blocks OPENJPA-736 [ OPENJPA-736 ]
          Hide
          Milosz Tylenda added a comment -

          DBDictionary says:

          metaData = conn.getMetaData();
          try

          { // JDBC3-only method, so it might throw a // AbstractMethodError isJDBC3 = metaData.getJDBCMajorVersion() >= 3; supportsGetGeneratedKeys = metaData.supportsGetGeneratedKeys(); }

          catch (Throwable t)

          { // ignore if not JDBC3 }

          However, DelegatingDatabaseMetaData.supportsGetGeneratedKeys always throws an exception:

          public boolean supportsGetGeneratedKeys() throws SQLException

          { throw new UnsupportedOperationException(); }

          Now , as OpenJPA requires Java 5 (JDBC 3), we probably can delegate all DelegatingDatabaseMetaData methods to the delegate or even get rid of DelegatingDatabaseMetaData completely.

          Show
          Milosz Tylenda added a comment - DBDictionary says: metaData = conn.getMetaData(); try { // JDBC3-only method, so it might throw a // AbstractMethodError isJDBC3 = metaData.getJDBCMajorVersion() >= 3; supportsGetGeneratedKeys = metaData.supportsGetGeneratedKeys(); } catch (Throwable t) { // ignore if not JDBC3 } However, DelegatingDatabaseMetaData.supportsGetGeneratedKeys always throws an exception: public boolean supportsGetGeneratedKeys() throws SQLException { throw new UnsupportedOperationException(); } Now , as OpenJPA requires Java 5 (JDBC 3), we probably can delegate all DelegatingDatabaseMetaData methods to the delegate or even get rid of DelegatingDatabaseMetaData completely.
          Hide
          Milosz Tylenda added a comment -

          The patch delegates all JDBC 3 methods to the delegate instead of throwing exceptions.

          Show
          Milosz Tylenda added a comment - The patch delegates all JDBC 3 methods to the delegate instead of throwing exceptions.
          Milosz Tylenda made changes -
          Attachment OPENJPA-847.patch [ 12398681 ]
          Milosz Tylenda made changes -
          Assignee Milosz Tylenda [ milosz ]
          Hide
          Milosz Tylenda added a comment -

          Change applied to trunk.

          Show
          Milosz Tylenda added a comment - Change applied to trunk.
          Hide
          Milosz Tylenda added a comment -

          Change applied also to 1.3.x branch.

          Show
          Milosz Tylenda added a comment - Change applied also to 1.3.x branch.
          Milosz Tylenda made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.3.0 [ 12313326 ]
          Fix Version/s 2.0.0 [ 12313483 ]
          Resolution Fixed [ 1 ]
          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          150d 23h 38m 1 Milosz Tylenda 31/May/09 09:57
          Resolved Resolved Closed Closed
          282d 8h 33m 1 Donald Woods 09/Mar/10 18:31

            People

            • Assignee:
              Milosz Tylenda
              Reporter:
              Milosz Tylenda
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development