db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6496) Optional tool registration may fail because the CompilerContext is not always available at execution time.
Date Thu, 06 Mar 2014 08:52:43 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13922174#comment-13922174
] 

Knut Anders Hatlen commented on DERBY-6496:
-------------------------------------------

The fix makes the repro for DERBY-6442 pass too, so it seems they indeed do have the same
root cause. Thanks for fixing it.

I was a little confused by the test case, though. The comments indicate that it tests something
related to granting permissions, but I don't see anything permission-related in the actual
test.

I wonder if the test might be clearer if the two test methods are merged into one test method.
In its current shape, someone without context might see that the two test methods are identical,
think that the second one is redundant, and remove it.

Is it essential for the test that the connections are opened as the TEST_DBO user? If not,
it's probably better to use openDefaultConnection() instead of openUserConnection(TEST_DBO).

Nit: Most of the imports in the test are unused, and org.apache.derbyTesting.junit.JDBC is
imported three times.

> Optional tool registration may fail because the CompilerContext is not always available
at execution time.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6496
>                 URL: https://issues.apache.org/jira/browse/DERBY-6496
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-6496-01-aa-useClassFactoryContext.diff, derby-6496-01-ab-useClassFactoryContext.diff
>
>
> For reasons which elude me, the CompilerContext is sometimes available at execution time
and sometimes not. When the CompilerContext is not available at execution time, optional tool
loading fails on an NPE:
> Caused by: java.lang.NullPointerException
> 	at org.apache.derby.catalog.Java5SystemProcedures.SYSCS_REGISTER_TOOL(Java5SystemProcedures.java:104)
> 	at org.apache.derby.exe.ac4d3680a5x0144x93adx0136xffffe1d7aa3e0.g0(Unknown Source)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
> 	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:349)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1338)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message