Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.1.0, 1.2.1, 1.3.0, 2.0.0-M2
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: jdbc
    • Labels:
      None

      Description

      Derby 10.4.1.3 DERBY-3460 added new reserved words:NONE and CURRENT_ROLE.
      Derby 10.5.2.0 DERBY-4268 added new reserved word: SECURITY.

        Activity

        Donald Woods created issue -
        Hide
        Donald Woods added a comment -

        Found some other reserved words to include in the latest Derby 10.5 docs at - http://db.apache.org/derby/docs/10.5/ref/ref-single.html#rrefkeywords29722

        Show
        Donald Woods added a comment - Found some other reserved words to include in the latest Derby 10.5 docs at - http://db.apache.org/derby/docs/10.5/ref/ref-single.html#rrefkeywords29722
        Hide
        Donald Woods added a comment -

        Example of the 112 failures caused by moving up to Derby 10.4.2.0, which now reserves "none" as a keyword -
        testFieldDefaultTimeZone(org.apache.openjpa.persistence.kernel.TestCalendarFields) Time elapsed: 6.465 sec <<< ERROR!
        <openjpa-2.0.0-SNAPSHOT-r422266:802138M nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Syntax error: Encountered "none" at line 2, column 50.

        {stmnt 1501285943 CREATE TABLE nullvalue -- Inner (Id INTEGER NOT NULL, exception_col INTEGER, none INTEGER, PRIMARY KEY (Id))}

        [code=30000, state=42X01]
        at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:553)
        at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:453)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:163)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:119)
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:160)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:219)

        Show
        Donald Woods added a comment - Example of the 112 failures caused by moving up to Derby 10.4.2.0, which now reserves "none" as a keyword - testFieldDefaultTimeZone(org.apache.openjpa.persistence.kernel.TestCalendarFields) Time elapsed: 6.465 sec <<< ERROR! <openjpa-2.0.0-SNAPSHOT-r422266:802138M nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Syntax error: Encountered "none" at line 2, column 50. {stmnt 1501285943 CREATE TABLE nullvalue -- Inner (Id INTEGER NOT NULL, exception_col INTEGER, none INTEGER, PRIMARY KEY (Id))} [code=30000, state=42X01] at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:553) at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:453) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:163) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:119) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:160) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:219)
        Hide
        Donald Woods added a comment -

        The following reserved words were added, based on the Derby 10.5 docs -
        COALESCE, CURRENT_ROLE, GETCURRENTCONNECTION, NONE, OVER, ROW_NUMBER, XMLQUERY

        Show
        Donald Woods added a comment - The following reserved words were added, based on the Derby 10.5 docs - COALESCE, CURRENT_ROLE, GETCURRENTCONNECTION, NONE, OVER, ROW_NUMBER, XMLQUERY
        Donald Woods made changes -
        Field Original Value New Value
        Attachment OPENJPA-1233.patch [ 12416066 ]
        Hide
        Donald Woods added a comment -

        Rev802801 resolves the 112 test failures due to using column name "none", but there are still 2 other test failures that need to be addressed before we can upgrade to a newer Derby level.

        testVariableHaving(org.apache.openjpa.persistence.jdbc.query.TestJDBCGrouping) Time elapsed: 0.093 sec <<< ERROR!
        <openjpa-2.0.0-SNAPSHOT-r422266:802138M nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Java exception: ': java.lang.NullPointerExc
        eption'.

        {prepstmnt 2022464090 SELECT MAX(t0.longField), t2.byteField FROM AllFieldTypes t0 INNER JOIN AllFieldTypes_AllFieldTypes t1 ON t0.id = t1.ALLFIELDTYPE S_ID JOIN AllFieldTypes t2 ON (1 = 1) WHERE (t1.SELFONEMANY_ID = t2.id) GROUP BY t2.byteField HAVING SUM(t2.intField) = ? [params=(long) 2]}

        [code=0, state=XJ00
        1] at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4554) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4507)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
        at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
        at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40)
        at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1239)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1000)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:856)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:787)
        at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
        at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:291)
        at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:303)

        testAggregateExpressionInHavingExpression(org.apache.openjpa.persistence.jdbc.query.TestMultipleEntityProjection) Time elapsed: 0.055 sec <<< ERROR!
        <openjpa-2.0.0-SNAPSHOT-r422266:802138M fatal general error> org.apache.openjpa.persistence.PersistenceException: An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BIGINT'.
        at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4548)
        at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4507)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
        at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
        at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40)
        at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1239)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1000)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:856)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:787)
        at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
        at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:291)
        at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:303)
        at org.apache.openjpa.persistence.jdbc.query.TestMultipleEntityProjection.testAggregateExpressionInHavingExpression(TestMultipleEntityProjection.java:159)

        Show
        Donald Woods added a comment - Rev802801 resolves the 112 test failures due to using column name "none", but there are still 2 other test failures that need to be addressed before we can upgrade to a newer Derby level. testVariableHaving(org.apache.openjpa.persistence.jdbc.query.TestJDBCGrouping) Time elapsed: 0.093 sec <<< ERROR! <openjpa-2.0.0-SNAPSHOT-r422266:802138M nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Java exception: ': java.lang.NullPointerExc eption'. {prepstmnt 2022464090 SELECT MAX(t0.longField), t2.byteField FROM AllFieldTypes t0 INNER JOIN AllFieldTypes_AllFieldTypes t1 ON t0.id = t1.ALLFIELDTYPE S_ID JOIN AllFieldTypes t2 ON (1 = 1) WHERE (t1.SELFONEMANY_ID = t2.id) GROUP BY t2.byteField HAVING SUM(t2.intField) = ? [params=(long) 2]} [code=0, state=XJ00 1] at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4554) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4507) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64) at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155) at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1239) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1000) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:856) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:787) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:291) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:303) testAggregateExpressionInHavingExpression(org.apache.openjpa.persistence.jdbc.query.TestMultipleEntityProjection) Time elapsed: 0.055 sec <<< ERROR! <openjpa-2.0.0-SNAPSHOT-r422266:802138M fatal general error> org.apache.openjpa.persistence.PersistenceException: An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BIGINT'. at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4548) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4507) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64) at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155) at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1239) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1000) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:856) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:787) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:291) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:303) at org.apache.openjpa.persistence.jdbc.query.TestMultipleEntityProjection.testAggregateExpressionInHavingExpression(TestMultipleEntityProjection.java:159)
        Hide
        Donald Woods added a comment -

        The above 2 testcases fail for both Derby 10.3.3.0 and 10.4.2.0....

        Show
        Donald Woods added a comment - The above 2 testcases fail for both Derby 10.3.3.0 and 10.4.2.0....
        Hide
        Donald Woods added a comment -

        The 2 failing tests look like Derby regressions in 10.3.3.0 and 10.4.2.0, as the tests pass with the latest 10.3 branch (post 10.3.3.0 Rev802635) and the 10.5 branch (Rev802917) which is supposed to be released as 10.5.3.0 by the end of this month. Will modify this issue to address just the missing reserved words and will leave upgrading Derby versions to a future JIRA.

        Show
        Donald Woods added a comment - The 2 failing tests look like Derby regressions in 10.3.3.0 and 10.4.2.0, as the tests pass with the latest 10.3 branch (post 10.3.3.0 Rev802635) and the 10.5 branch (Rev802917) which is supposed to be released as 10.5.3.0 by the end of this month. Will modify this issue to address just the missing reserved words and will leave upgrading Derby versions to a future JIRA.
        Donald Woods made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Resolution Fixed [ 1 ]
        Donald Woods made changes -
        Issue Type Bug [ 1 ] Sub-task [ 7 ]
        Parent OPENJPA-1209 [ 12431757 ]
        Hide
        Donald Woods added a comment -

        Mike, can we consider including this in the 1.2.x stream, since Apache Geronimo is using OpenJPA 1.2.1 and Derby 10.4.2.0?

        Show
        Donald Woods added a comment - Mike, can we consider including this in the 1.2.x stream, since Apache Geronimo is using OpenJPA 1.2.1 and Derby 10.4.2.0?
        Donald Woods made changes -
        Assignee Donald Woods [ drwoods ] Michael Dick [ mikedd ]
        Donald Woods made changes -
        Assignee Michael Dick [ mikedd ] Donald Woods [ drwoods ]
        Hide
        Michael Dick added a comment -

        Hi Donald, unfortunately (or fortunately I guess) Geronimo isn't the only user (embedder) of OpenJPA 1.2.x and some of the other user have not moved up to Derby 1.4, or 1.5.

        If these are new reserved words then they could cause existing apps to fail, given the conservative nature of some of the users I'm not going to make this change in 1.2.x. Users who move up to newer versions of Derby can manually update their entities to avoid the new reserved names (not terribly friendly - but at least they have relief).

        Show
        Michael Dick added a comment - Hi Donald, unfortunately (or fortunately I guess) Geronimo isn't the only user (embedder) of OpenJPA 1.2.x and some of the other user have not moved up to Derby 1.4, or 1.5. If these are new reserved words then they could cause existing apps to fail, given the conservative nature of some of the users I'm not going to make this change in 1.2.x. Users who move up to newer versions of Derby can manually update their entities to avoid the new reserved names (not terribly friendly - but at least they have relief).
        Hide
        Milosz Tylenda added a comment -

        Hi Mike & Donald. I believe we have a dictionary property users can add reserved words thru although I did not test it. On the other hand, I am not sure we are correctly handling reserved words in the 1.2.x branch anyways - see OPENJPA-946.

        Show
        Milosz Tylenda added a comment - Hi Mike & Donald. I believe we have a dictionary property users can add reserved words thru although I did not test it. On the other hand, I am not sure we are correctly handling reserved words in the 1.2.x branch anyways - see OPENJPA-946 .
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development