Title: NullPointerException during shutdown compact
I responded to this but there was no feedback from Stephen.
 
The NPE can happen only if the process to reopen the database during shutdown compact fails. Such a failure should not happen, but in any case you can patch the code for clearStructures() in Database.java to avoid the NPE (see below). The program will then throw the exception that caused the reopen process to fail and you can report it.   In recent weeks, unexpected programs have been traced to failure to upgrade the old databases fully. So if you are using an old database, follow the updated instructions in the Advanced Topics chapter of the new Guide in RC6c package. Once you have done these, please report the results.
 
Fred
 
    void clearStructures() {
 
        if (tTable != null){
            for (int i = 0; i < tTable.size(); i++) {
                Table table = (Table) tTable.get(i);
 
                table.dropTriggers();
            }
        }
 
----- Original Message -----
Sent: 22 June 2004 18:03
Subject: RE: [Hsqldb-developers] NullPointerException during shutdown compact

I never saw the response to this one if anyone had it - using the latest RC we're seeing this problem frequently on a shutdown/compact and also we've hit a different issue with an index out of bounds error during normal operations - does anyone have a clue what could cause this particular one though?
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Chen
Sent: Tuesday, June 08, 2004 11:50 AM
To: '[EMAIL PROTECTED]'
Subject: [Hsqldb-developers] NullPointerException during shutdown compact

While running HSQLDB 1.7.2 RC 6b in client/server mode, using dbmgr to issue "shutdown compact" resulted in the following:

[EMAIL PROTECTED]: From command line, use [Ctrl]+[C] to abort abruptly
java.lang.NullPointerException
        at org.hsqldb.Database.clearStructures(Unknown Source)
        at org.hsqldb.Database.close(Unknown Source)
        at org.hsqldb.DatabaseCommandInterpreter.processShutdown(Unknown Source)

        at org.hsqldb.DatabaseCommandInterpreter.executePart(Unknown Source)
        at org.hsqldb.DatabaseCommandInterpreter.execute(Unknown Source)
        at org.hsqldb.Session.sqlExecuteDirectNoPreChecks(Unknown Source)
        at org.hsqldb.Session.execute(Unknown Source)
        at org.hsqldb.ServerConnection.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

I can see in Database.java that clearStructures iterates over the tables (tTable) and drops the triggers, but there is no check for a null entry. I don't see how the table entry could be null, but the database could be in a bad state. I could add a check to prevent the null pointer exception, but is there a way that the table entry should be null? If the table entry is nulled, clearStructures would be too late to track when it occurs.

Also, using dbmgr to issue "script 'file'" results in a SQL error message "Assert failure in statement [SCRIPT 'file'] / Error code: -38, State: S1000". Right now, I'm not sure if this is related to the shutdown compact problem.

Thank you for your time.

Stephen Chen,   Product Developer
Visionael Corporation

Reply via email to