Rave
  1. Rave
  2. RAVE-502

Unable to load an initial_data.sql file in Oracle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8-INCUBATING
    • Fix Version/s: 0.9-INCUBATING
    • Component/s: None
    • Labels:
      None

      Description

      When loading an initial_data.sql file in Oracle the o.a.r.jdbc.util.DataSourcePopulator fails with an "Invalid operation for forward only resultset : first". This is because the Statement is producing a non-scrollable ResultSet.

      Fix: Create the Statement with a ResultSet.TYPE_SCROLL_INSENSITIVE flag.

        Activity

        Hide
        Jasha Joachimsthal added a comment -

        Are the SQL statements in initial_data.sql now compatible with Oracle? In http://incubator.apache.org/rave/documentation/configure-database.html we have a minimal set of queries necessary to run the portal with a completely different SQL syntax.

        Show
        Jasha Joachimsthal added a comment - Are the SQL statements in initial_data.sql now compatible with Oracle? In http://incubator.apache.org/rave/documentation/configure-database.html we have a minimal set of queries necessary to run the portal with a completely different SQL syntax.
        Hide
        Anthony Carlucci added a comment -

        Unfortunately no...once I fixed this issue I'm running into a problem with the SqlFileParser class that tries to filter out invalid statements and isn't taking into account certain Oracle keywords like DECLARE, BEGIN, etc. Also, to define a variable in Oracle the syntax looks like:

        myVar NUMBER(10);

        so there is no SQL keyword in front, and thus the SqlFileParser will never execute these lines. I decided to run our Oracle initial_data.sql files manually, as you had written up in the documentation, instead. Given that our reference implementation is running on H2 I didn't want to start changing the SqlFileParser / DataSourcePopulator classes. Do we (the community) think we need to support other databases besides H2 using the DataSourcePopulator feature?

        Show
        Anthony Carlucci added a comment - Unfortunately no...once I fixed this issue I'm running into a problem with the SqlFileParser class that tries to filter out invalid statements and isn't taking into account certain Oracle keywords like DECLARE, BEGIN, etc. Also, to define a variable in Oracle the syntax looks like: myVar NUMBER(10); so there is no SQL keyword in front, and thus the SqlFileParser will never execute these lines. I decided to run our Oracle initial_data.sql files manually, as you had written up in the documentation, instead. Given that our reference implementation is running on H2 I didn't want to start changing the SqlFileParser / DataSourcePopulator classes. Do we (the community) think we need to support other databases besides H2 using the DataSourcePopulator feature?
        Hide
        marijan milicevic added a comment -

        please also see discussion (Matt's reply) @:

        https://issues.apache.org/jira/browse/RAVE-392

        Show
        marijan milicevic added a comment - please also see discussion (Matt's reply) @: https://issues.apache.org/jira/browse/RAVE-392

          People

          • Assignee:
            Anthony Carlucci
            Reporter:
            Anthony Carlucci
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development