You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by MartinEW <ma...@sun.com> on 2009/01/29 12:36:27 UTC

NPE from NoRowsResultSetImpl.close()

I am receiving a NPE when attempting to delete records from tables. I have
attached a simplified SQL script that replicates my problem - 
http://www.nabble.com/file/p21725256/script.sql script.sql .  Can anyone
else replicate this issue?  

The exception is: 

2009-01-29 11:22:51.346 GMT Thread[DRDAConnThread_20,5,derby.daemons] (XID =
2515), (SESSIONID = 35), (DATABASE = test), (DRDAID =
NF000001.E18A-522134848570106079{35}), Cleanup action starting
2009-01-29 11:22:51.346 GMT Thread[DRDAConnThread_20,5,derby.daemons] (XID =
2515), (SESSIONID = 35), (DATABASE = test), (DRDAID =
NF000001.E18A-522134848570106079{35}), Failed Statement is: delete from
collectives
java.lang.NullPointerException
        at
org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.close(Unknown Source)
        at org.apache.derby.impl.sql.execute.DeleteResultSet.cleanUp(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.open(Unknown
Source)
        at
org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
2009-01-29 11:22:51.346 GMT Thread[DRDAConnThread_20,5,derby.daemons]
Equally severe exception raised during cleanup (ignored) null
java.lang.NullPointerException
        at
org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.close(Unknown Source)
        at org.apache.derby.impl.sql.execute.DeleteResultSet.cleanUp(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
Source)
        at
org.apache.derby.impl.sql.conn.GenericStatementContext.cleanupOnError(Unknown
Source)
        at
org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(Unknown
Source)
        at
org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(Unknown
Source)
        at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
        at
org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at
org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
        at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Cleanup action completed

Thanks

Martin

-- 
View this message in context: http://www.nabble.com/NPE-from-NoRowsResultSetImpl.close%28%29-tp21725256p21725256.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: NPE from NoRowsResultSetImpl.close()

Posted by Kristian Waagan <Kr...@Sun.COM>.
Martin Walsh wrote:
> Hi Kristian,
> 
>> Can you specify the Derby version you used, and on which operating 
>> system you saw the problem?
> 
> Derby - 10.4.2.0
> OS - Solaris snv103
> J2SE 6
> 
> When creating a fresh DB and running the script it worked for me also. I 
> was using a DB that was already there.  But once I applied the following 
> properties it starts to fail again.  I am trying to identify which 
> property is causing the issue now.
> 
> 
> -- Only use properties stored in the database.
> call syscs_util.syscs_set_database_property(
>   'derby.database.propertiesOnly', 'true');
> 
> -- Set access permissions.
> call syscs_util.syscs_set_database_property(
>   'derby.authentication.provider', 'BUILTIN');
> call syscs_util.syscs_set_database_property(
>   'derby.connection.requireAuthentication', 'true');
> call syscs_util.syscs_set_database_property(
>   'derby.database.fullAccessUsers', 'auth');
> call syscs_util.syscs_set_database_property(
>   'derby.database.readOnlyAccessUsers', 'readonly');
> 
> -- Create the readonly user.
> call syscs_util.syscs_set_database_property(
>   'derby.user.readonly', 'readonly');
> 
> -- Drop the default schema.
> drop schema app restrict;
> 
> -- Change the page size for the database.
> -- call syscs_util.syscs_set_database_property(
> --   'derby.storage.pageSize', '4096');
> 
> -- Save query plans - only for development.
> call syscs_util.syscs_set_database_property(
>   'derby.language.logQueryPlan', 'true');

Thanks Martin,

This seems to confirm what Knut Anders reported; 
https://issues.apache.org/jira/browse/DERBY-2353


-- 
Kristian

> 
> commit;
> 
> Martin
> 
> 
> 


Re: NPE from NoRowsResultSetImpl.close()

Posted by Martin Walsh <Ma...@Sun.COM>.
Hi Kristian,

> Can you specify the Derby version you used, and on which operating 
> system you saw the problem?

Derby - 10.4.2.0
OS - Solaris snv103
J2SE 6

When creating a fresh DB and running the script it worked for me also. I 
was using a DB that was already there.  But once I applied the following 
properties it starts to fail again.  I am trying to identify which 
property is causing the issue now.


-- Only use properties stored in the database.
call syscs_util.syscs_set_database_property(
   'derby.database.propertiesOnly', 'true');

-- Set access permissions.
call syscs_util.syscs_set_database_property(
   'derby.authentication.provider', 'BUILTIN');
call syscs_util.syscs_set_database_property(
   'derby.connection.requireAuthentication', 'true');
call syscs_util.syscs_set_database_property(
   'derby.database.fullAccessUsers', 'auth');
call syscs_util.syscs_set_database_property(
   'derby.database.readOnlyAccessUsers', 'readonly');

-- Create the readonly user.
call syscs_util.syscs_set_database_property(
   'derby.user.readonly', 'readonly');

-- Drop the default schema.
drop schema app restrict;

-- Change the page size for the database.
-- call syscs_util.syscs_set_database_property(
--   'derby.storage.pageSize', '4096');

-- Save query plans - only for development.
call syscs_util.syscs_set_database_property(
   'derby.language.logQueryPlan', 'true');

commit;

Martin




Re: NPE from NoRowsResultSetImpl.close()

Posted by Alan Burlison <Al...@sun.com>.
Kristian Waagan wrote:

>> Where did you get 10.4.2.1 from?  I can only find 10.4.2.0 on the 
>> Derby site.
> 
> Sorry, I used Derby trunk and Derby 10.3.3.0.
> The last one I tried with was Java DB 10.4.2.1, which can be found on 
> the Sun Developer Network site.

Interesting, I didn't know there was a later version on there.  I'll 
keep an eye on SDN for future updates, thanks.

-- 
Alan Burlison
--

Re: NPE from NoRowsResultSetImpl.close()

Posted by Kristian Waagan <Kr...@Sun.COM>.
Alan Burlison wrote:
> Kristian Waagan wrote:
> 
>> I was unable to reproduce when I tried to run the script with Derby 
>> trunk, 10.4.2.1 and 10.3.3.0. I did this on OpenSolaris with Java SE 6.
>> I connected to an empty database with the network driver, using ij and 
>> then ran the script.
> 
> Where did you get 10.4.2.1 from?  I can only find 10.4.2.0 on the Derby 
> site.

Hi Alan,

Sorry, I used Derby trunk and Derby 10.3.3.0.
The last one I tried with was Java DB 10.4.2.1, which can be found on 
the Sun Developer Network site.


Regards,
-- 
Kristian

> 
> Thanks,
> 


Re: NPE from NoRowsResultSetImpl.close()

Posted by Alan Burlison <Al...@sun.com>.
Kristian Waagan wrote:

> I was unable to reproduce when I tried to run the script with Derby 
> trunk, 10.4.2.1 and 10.3.3.0. I did this on OpenSolaris with Java SE 6.
> I connected to an empty database with the network driver, using ij and 
> then ran the script.

Where did you get 10.4.2.1 from?  I can only find 10.4.2.0 on the Derby 
site.

Thanks,

-- 
Alan Burlison
--

Re: NPE from NoRowsResultSetImpl.close()

Posted by Kristian Waagan <Kr...@Sun.COM>.
MartinEW wrote:
> I am receiving a NPE when attempting to delete records from tables. I have
> attached a simplified SQL script that replicates my problem - 
> http://www.nabble.com/file/p21725256/script.sql script.sql .  Can anyone
> else replicate this issue?  

Hello Martin,

I was unable to reproduce when I tried to run the script with Derby 
trunk, 10.4.2.1 and 10.3.3.0. I did this on OpenSolaris with Java SE 6.
I connected to an empty database with the network driver, using ij and 
then ran the script.

Can you specify the Derby version you used, and on which operating 
system you saw the problem?


-- 
Kristian

> 
> The exception is: 
> 
> 2009-01-29 11:22:51.346 GMT Thread[DRDAConnThread_20,5,derby.daemons] (XID =
> 2515), (SESSIONID = 35), (DATABASE = test), (DRDAID =
> NF000001.E18A-522134848570106079{35}), Cleanup action starting
> 2009-01-29 11:22:51.346 GMT Thread[DRDAConnThread_20,5,derby.daemons] (XID =
> 2515), (SESSIONID = 35), (DATABASE = test), (DRDAID =
> NF000001.E18A-522134848570106079{35}), Failed Statement is: delete from
> collectives
> java.lang.NullPointerException
>         at
> org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.close(Unknown Source)
>         at org.apache.derby.impl.sql.execute.DeleteResultSet.cleanUp(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.open(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
>         at
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> 2009-01-29 11:22:51.346 GMT Thread[DRDAConnThread_20,5,derby.daemons]
> Equally severe exception raised during cleanup (ignored) null
> java.lang.NullPointerException
>         at
> org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.close(Unknown Source)
>         at org.apache.derby.impl.sql.execute.DeleteResultSet.cleanUp(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.execute.DeleteCascadeResultSet.cleanUp(Unknown
> Source)
>         at
> org.apache.derby.impl.sql.conn.GenericStatementContext.cleanupOnError(Unknown
> Source)
>         at
> org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(Unknown
> Source)
>         at
> org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(Unknown
> Source)
>         at
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
> Source)
>         at
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
>         at
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
>         at
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> Cleanup action completed
> 
> Thanks
> 
> Martin
> 


Re: NPE from NoRowsResultSetImpl.close()

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
MartinEW <Ma...@Sun.COM> writes:

> I am receiving a NPE when attempting to delete records from tables. I have
> attached a simplified SQL script that replicates my problem - 
> http://www.nabble.com/file/p21725256/script.sql script.sql .  Can anyone
> else replicate this issue?  

Thanks for the script, I can reproduce it when I set
derby.language.logQueryPlan=true. I think this is
https://issues.apache.org/jira/browse/DERBY-2353, which is closed as
Cannot Reproduce. I'll reopen it and post a pointer to this discussion.

The workaround is to not set derby.language.logQueryPlan.

-- 
Knut Anders