You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kevin Sutter (JIRA)" <ji...@apache.org> on 2008/04/03 15:08:24 UTC

[jira] Commented: (OPENJPA-555) MappingTool got NullPointerException in DB2Dictionary.isDB2ZOSV8xOrLater()

    [ https://issues.apache.org/jira/browse/OPENJPA-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585096#action_12585096 ] 

Kevin Sutter commented on OPENJPA-555:
--------------------------------------

Catalina, is the check for a null databaseProductName sufficient?  I mean, if the DB2Dictionary has not been initialized, then your changed methods will now be returning "false".  But, we very well could be using one of the versions of DB2.  We just haven't initialized and, thus, we don't know whether we're using one of the desired versions of DB2.  Especially since we're dealing with the MappingTool.  I would assume that we make some decisions on how to perform the mapping based on the version of DB2 that we're using.  Otherwise, why would these methods be invoked in the first place?  From the text in the forum, it sounds like with this change, the index won't automatically be created if we fall into this scenario.  This just doesn't sound like the right fix.  Please justify.  Thanks.



> MappingTool got NullPointerException in DB2Dictionary.isDB2ZOSV8xOrLater()
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-555
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-555
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>            Reporter: Catalina Wei
>            Assignee: Catalina Wei
>             Fix For: 1.0.3, 1.1.0
>
>
> MappingTool got NullPointerException in DB2Dictionary.isDB2ZOSV8xOrLater()
> As reported by Amy :
> java.lang.NullPointerException
>     at
> org.apache.openjpa.jdbc.sql.DB2Dictionary.isDB2ZOSV8xOrLater(DB2Dictionary.java:392)
>     at
> org.apache.openjpa.jdbc.sql.DB2Dictionary.createIndexIfNecessary(DB2Dictionary.java:784)
>     at
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.addSchema(TableJDBCSeq.java:244)
>     at
> org.apache.openjpa.jdbc.meta.MappingTool.addSequenceComponents(MappingTool.java:609)
>     at
> org.apache.openjpa.jdbc.meta.MappingTool.addSequenceComponents(MappingTool.java:591)
>     at
> org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:477)
>     at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1075)
>     at
> org.apache.openjpa.jdbc.ant.MappingToolTask.executeOn(MappingToolTask.java:197)
>     at
> org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:172)
>     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>     at org.apache.tools.ant.Task.perform(Task.java:364)
>     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:64)
>     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>     at org.apache.tools.ant.Task.perform(Task.java:364)
> The scenario is using the ant task of MappingTool to build schema
> for some JDO classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (OPENJPA-555) MappingTool got NullPointerException in DB2Dictionary.isDB2ZOSV8xOrLater()

Posted by catalina wei <ca...@gmail.com>.
Hi Kevin,
There is issue OPENJPA-549 addressing your concern -- if DB2Dictionary has
not been initialized, what should be the default version of DB2.

OPENJPA-555 is only fixing a bad coding style to avoid null pointer
exception.

Catalina

On 4/3/08, Kevin Sutter (JIRA) <ji...@apache.org> wrote:
>
>
>     [
> https://issues.apache.org/jira/browse/OPENJPA-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585096#action_12585096]
>
> Kevin Sutter commented on OPENJPA-555:
> --------------------------------------
>
> Catalina, is the check for a null databaseProductName sufficient?  I mean,
> if the DB2Dictionary has not been initialized, then your changed methods
> will now be returning "false".  But, we very well could be using one of the
> versions of DB2.  We just haven't initialized and, thus, we don't know
> whether we're using one of the desired versions of DB2.  Especially since
> we're dealing with the MappingTool.  I would assume that we make some
> decisions on how to perform the mapping based on the version of DB2 that
> we're using.  Otherwise, why would these methods be invoked in the first
> place?  From the text in the forum, it sounds like with this change, the
> index won't automatically be created if we fall into this scenario.  This
> just doesn't sound like the right fix.  Please justify.  Thanks.
>
>
>
> > MappingTool got NullPointerException in
> DB2Dictionary.isDB2ZOSV8xOrLater()
> >
> --------------------------------------------------------------------------
> >
> >                 Key: OPENJPA-555
> >                 URL: https://issues.apache.org/jira/browse/OPENJPA-555
> >             Project: OpenJPA
> >          Issue Type: Bug
> >          Components: jdbc
> >            Reporter: Catalina Wei
> >            Assignee: Catalina Wei
> >             Fix For: 1.0.3, 1.1.0
> >
> >
> > MappingTool got NullPointerException in
> DB2Dictionary.isDB2ZOSV8xOrLater()
> > As reported by Amy :
> > java.lang.NullPointerException
> >     at
> >
> org.apache.openjpa.jdbc.sql.DB2Dictionary.isDB2ZOSV8xOrLater(DB2Dictionary.java:392)
> >     at
> >
> org.apache.openjpa.jdbc.sql.DB2Dictionary.createIndexIfNecessary(DB2Dictionary.java:784)
> >     at
> >
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.addSchema(TableJDBCSeq.java:244)
> >     at
> >
> org.apache.openjpa.jdbc.meta.MappingTool.addSequenceComponents(MappingTool.java:609)
> >     at
> >
> org.apache.openjpa.jdbc.meta.MappingTool.addSequenceComponents(MappingTool.java:591)
> >     at
> > org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:477)
> >     at
> org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1075)
> >     at
> >
> org.apache.openjpa.jdbc.ant.MappingToolTask.executeOn(MappingToolTask.java:197)
> >     at
> > org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:172)
> >     at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> >     at org.apache.tools.ant.Task.perform(Task.java:364)
> >     at
> org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:64)
> >     at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> >     at org.apache.tools.ant.Task.perform(Task.java:364)
> > The scenario is using the ant task of MappingTool to build schema
> > for some JDO classes.
>
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>