Uploaded image for project: 'Hibernate ORM'
  1. HHH-9286

Extended Stored procedure support does not work with Oracle

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.4
    • Fix Version/s: 5.1.0, 5.0.8
    • Component/s: None
    • Environment:
      Java 7, JPA 2.1, Hibernate 4.3.5
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      I am attempting to use JPA 2.1 and Hibernate 4.3.5 with Java 7 with stored procedures. I am using Oracle10gDialect and Oracle jdbc drivers for 11g. There seems to be at least 2 problems with stored procedure support with Oracle. Since I am using Java 7
      and there are no Oracle drivers yet that support JDBC 4.2, stored procedures rely on the specific oracle dialect
      to set the parameters properly. Oracle uses Ref Cursor support to get results and that seems to be where the problem is.

      1) There is no support for using named parameters with stored procedures. The Oracle 8i dialect doesn't override:

       public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException
      

      so when this method is called an
      exception is thrown by the top level Dialect class that says it's not supported. I attempted to add this method to a custom dialect and it gave another exception saying that Ordinal binding and Named binding can not be combined.

      2) The oracle 8i dialect does not override:

      public ResultSet getResultSet(CallableStatement statement, int position) throws SQLException
      

      which causes stored procedures with
      positional parameters to also fail. Note that this method is in fact implemented in PostgresSQL81Dialect.
      When I tied a custom dialect that extended Oracle10gDialect and used the implementation from Postgres and this fixes the Oracle issue.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: