db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: NPE when compressing large table
Date Wed, 05 Sep 2012 17:12:54 GMT
I agree should log a JIRA then all the information and suggestions can
go there.  Having a line number would help a lot for exact cause of the
null pointer.

Historically SYSCS_COMPRESS_TABLE has been the most stable of the 2 
compression techniques, and is the one I most recommend.

The lowest part of the stack looks kind of wierd, but hard to know
exactly what is going on as part of the stack is missing.  It sort of
looks like it is failing while setting up a connection rather than in
your code.  Can you tell from the line numbers where in your code it
is failing?

Also include full derby.log, sometimes that can give more information.

I can't tell from your program fragment.  Is the connection autocommit 
on or off?  If it is on, there might be a problem with your resultset.

On 9/4/2012 7:39 PM, Brett Wooldridge wrote:
> This looks like a bug to me, I recommend you open one.  You might also
> try SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE.  If you can copy the DB to
> your dev environment, reproduce the issue, and run a derby 10.8.2.2
> built with line numbers, it would probably help the devs pinpoint the issue.
>
> Brett
>
> On Wed, Sep 5, 2012 at 5:11 AM, Erick Lichtas <elichtas@lichtasweb.com
> <mailto:elichtas@lichtasweb.com>> wrote:
>
>     Hi Everyone,____
>
>     __ __
>
>     I am having an issue with the SYSCS_UTIL.SYSCS_COMPRESS_TABLE
>     operation on a large table in Derby 10.8.2.2.____
>
>     __ __
>
>     Statement stmt = *null*;____
>
>     CallableStatement cs = *null*;____
>
>     *try*{____
>
>             String sql = "select schemaname, tablename from
>     sys.sysschemas s, "____
>
>                    + "sys.systables t where s.schemaid=t.schemaid and
>     t.tabletype='T'";____
>
>             stmt = con.createStatement();____
>
>             ResultSet rs = stmt.executeQuery(sql);____
>
>             cs = con.prepareCall("call
>     SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");____
>
>     *while*(rs.next()) {____
>
>                    String schema = rs.getString(1).trim();____
>
>                    String table = rs.getString(2).trim();____
>
>                    log("Compressing "+ schema + "."+ table + "...");____
>
>                    cs.setString(1, schema);____
>
>                    cs.setString(2, table);____
>
>                    cs.setShort(3, (*short*) 1);____
>
>                    cs.execute();____
>
>             }____
>
>     }____
>
>     *finally*{____
>
>     *if*(stmt != *null*) {____
>
>                    stmt.close();____
>
>             }____
>
>     *if*(cs != *null*) {____
>
>                    cs.close();____
>
>             }____
>
>     }____
>
>     __ __
>
>     The above code, successfully runs over 3 of 20 some tables, then
>     hits the 4^th table with over 2 million records.  After working on
>     this table for about 5 minutes, the process terminates with an
>     SQLException wrapping a NPE. ____
>
>     This happened in a production instance and I have not yet set up a
>     reproduction in a development environment.  I’m wondering if anyone
>     has any thoughts based on the stacktrace below?____
>
>     __ __
>
>     com.linoma.gaservices.upgrader.UpgradeException: Java exception: ':
>     java.lang.NullPointerException'.____
>
>                      at
>     com.linoma.gaservices.upgrader.DefaultUpgrader.upgrade(DefaultUpgrader.java:227)____
>
>                      at
>     com.linoma.gaservices.upgrader.UnixUpgrader.upgrade(UnixUpgrader.java:32)____
>
>                      at
>     com.linoma.gaservices.upgrader.UpgradeStarter.startUpgrade(UpgradeStarter.java:25)____
>
>                      at
>     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)____
>
>                      at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)____
>
>                      at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)____
>
>                      at java.lang.reflect.Method.invoke(Method.java:618)____
>
>                      at my.app.upgrader.Startup.main(Startup.java:72)____
>
>     Caused by: java.sql.SQLException: Java exception: ':
>     java.lang.NullPointerException'.____
>
>                      at
>     org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)____
>
>                      at
>     org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)____
>
>                      at
>     org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(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.EmbedConnection.<init>(Unknown Source)____
>
>                      at
>     org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)____
>
>                      at
>     org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)____
>
>                      at
>     org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)____
>
>                      at
>     java.sql.DriverManager.getConnection(DriverManager.java:572)____
>
>                      at
>     java.sql.DriverManager.getConnection(DriverManager.java:218)____
>
>                      at
>     my.app.upgrader.db.DerbyDatabaseUpgrader.closeDB(DerbyDatabaseUpgrader.java:99)____
>
>                      at
>     my.app.upgrader.DefaultUpgrader.upgrade(DefaultUpgrader.java:223)____
>
>                      ... 7 more ____
>
>     Caused by: java.lang.NullPointerException____
>
>                      at
>     org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)____
>
>                      at
>     org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndexMinion(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.initDefaultSchemaDescriptor(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.initialize(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.db.BasicDatabase.setupConnection(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.jdbc.TransactionResourceImpl.startTransaction(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.jdbc.EmbedConnection.checkUserIsNotARole(Unknown
>     Source)____
>
>                      at
>     org.apache.derby.impl.jdbc.EmbedConnection.checkUserCredentials(Unknown
>     Source)____
>
>                      ... 15 more ____
>
>     __ __
>
>     Regards,____
>
>     __ __
>
>     Erick____
>
>     __ __
>
>


Mime
View raw message