[ 
https://issues.apache.org/jira/browse/DERBY-4794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Manoranjan Sahu updated DERBY-4794:
-----------------------------------


I don't see any other exception other than that.
I am providing the the complete stack trace during a particular statement's 
execution.
--------------------------------------------------------------------------------------
2010-09-06 10:06:48.152 GMT Thread[AWT-EventQueue-0,6,main] (XID = 43707), 
(SESSIONID = 1), (DATABASE = C:\Documents and Settings\All Users\Application 
Data\XProtean\Telluride/xp_telluride_client), (DRDAID = null), Cleanup action 
starting

2010-09-06 10:06:48.152 GMT Thread[AWT-EventQueue-0,6,main] (XID = 43707), 
(SESSIONID = 1), (DATABASE = C:\Documents and Settings\All Users\Application 
Data\XProtean\Telluride/xp_telluride_client), (DRDAID = null), Failed Statement 
is: SELECT TS_LN_ITM_BGN, TS_LN_ITM_END, FL_VD_LN_ITM, LU_MTH_LTM_RTL_TRN, 
ID_TRN, ID_TRN_LTMGP, AI_LN_ITM, CD_TYP_LTM_TRN_RTL FROM tr_ltm_rtl_trn WHERE 
(ID_TRN = ?) with 1 parameters begin parameter #1: 53.51.2010-09-06.31 :end 
parameter 

java.lang.NullPointerException

        at 
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finishAndRTS(Unknown 
Source)

        at 
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.finish(Unknown 
Source)

        at org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown 
Source)

        at org.apache.derby.impl.sql.GenericActivationHolder.execute(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.EmbedPreparedStatement.executeStatement(Unknown 
Source)

        at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)

        at 
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:726)

        at 
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:501)

        at 
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)

        at 
oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:473)

        at 
oracle.toplink.essentials.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:152)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:285)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:615)

        at 
oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2416)

        at 
oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2394)

        at 
oracle.toplink.essentials.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:338)

        at 
oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:724)

        at 
oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)

        at 
oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:692)

        at 
oracle.toplink.essentials.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:1834)

        at 
oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)

        at 
oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:101)

        at 
oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:91)

        at 
oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)

        at 
oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:175)

        at 
oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:247)

        at 
oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)

        at 
oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:208)

        at 
oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:330)

        at 
oracle.toplink.essentials.indirection.IndirectList.isEmpty(IndirectList.java:408)

        at 
com.xp.txn.client.retail.RetailTxnFacadeClientImpl.isPartialPaymentDone(RetailTxnFacadeClientImpl.java:1347)

        at 
com.xp.txn.client.retail.RetailTxnFacadeClientImpl.processPrePayment(RetailTxnFacadeClientImpl.java:1337)

        at 
com.xp.txn.client.retail.RetailTxnFacadeClientImpl.issueStoreCredit(RetailTxnFacadeClientImpl.java:1702)

        at 
com.xp.ui.transaction.handler.RetailTransactionHandler.issueStoreCredit(RetailTransactionHandler.java:2524)

        at sun.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at 
com.xp.ui.framework.beanhandler.XPActionHandler$1.actionPerformed(XPActionHandler.java:154)

        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown 
Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.Component.processMouseEvent(Unknown Source)

        at javax.swing.JComponent.processMouseEvent(Unknown Source)

        at java.awt.Component.processEvent(Unknown Source)

        at java.awt.Container.processEvent(Unknown Source)

        at java.awt.Component.dispatchEventImpl(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Window.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.EventQueue.dispatchEvent(Unknown Source)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.run(Unknown Source)

2010-09-06 10:06:48.152 GMT Thread[AWT-EventQueue-0,6,main] Equally severe 
exception raised during cleanup (ignored) null

java.lang.NullPointerException

        at 
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finishAndRTS(Unknown 
Source)

        at 
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.finish(Unknown 
Source)

        at org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown 
Source)

        at 
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.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.EmbedPreparedStatement.executeStatement(Unknown 
Source)

        at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)

        at 
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:726)

        at 
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:501)

        at 
oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)

        at 
oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:473)

        at 
oracle.toplink.essentials.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:152)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:285)

        at 
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:615)

        at 
oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2416)

        at 
oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2394)

        at 
oracle.toplink.essentials.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:338)

        at 
oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:724)

        at 
oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)

        at 
oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:692)

        at 
oracle.toplink.essentials.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:1834)

        at 
oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)

        at 
oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:101)

        at 
oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:91)

        at 
oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)

        at 
oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:175)

        at 
oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:247)

        at 
oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)

        at 
oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:208)

        at 
oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:330)

        at 
oracle.toplink.essentials.indirection.IndirectList.isEmpty(IndirectList.java:408)

        at 
com.xp.txn.client.retail.RetailTxnFacadeClientImpl.isPartialPaymentDone(RetailTxnFacadeClientImpl.java:1347)

        at 
com.xp.txn.client.retail.RetailTxnFacadeClientImpl.processPrePayment(RetailTxnFacadeClientImpl.java:1337)

        at 
com.xp.txn.client.retail.RetailTxnFacadeClientImpl.issueStoreCredit(RetailTxnFacadeClientImpl.java:1702)

        at 
com.xp.ui.transaction.handler.RetailTransactionHandler.issueStoreCredit(RetailTransactionHandler.java:2524)

        at sun.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at 
com.xp.ui.framework.beanhandler.XPActionHandler$1.actionPerformed(XPActionHandler.java:154)

        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown 
Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.Component.processMouseEvent(Unknown Source)

        at javax.swing.JComponent.processMouseEvent(Unknown Source)

        at java.awt.Component.processEvent(Unknown Source)

        at java.awt.Container.processEvent(Unknown Source)

        at java.awt.Component.dispatchEventImpl(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Window.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.EventQueue.dispatchEvent(Unknown Source)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.run(Unknown Source)

Cleanup action completed

2010-09-06 10:06:48.199 GMT Thread[AWT-EventQueue-0,6,main] (XID = 43695), 
(SESSIONID = 6), (DATABASE = C:\Documents and Settings\All Users\Application 
Data\XProtean\Telluride/xp_telluride_client), (DRDAID = null), Committing

2010-09-06 10:06:48.199 GMT Thread[AWT-EventQueue-0,6,main] (XID = 43709), 
(SESSIONID = 6), (DATABASE = C:\Documents and Settings\All Users\Application 
Data\XProtean\Telluride/xp_telluride_client), (DRDAID = null), Executing 
prepared statement: SELECT str_prop_name, str_prop_Value FROM XP_EFT_CONFIG 
:End prepared statement

2010-09-06 10:06:48.199 GMT Thread[AWT-EventQueue-0,6,main] (XID = 43709), 
(SESSIONID = 6), SELECT str_prop_name, str_prop_Value FROM XP_EFT_CONFIG 
******* Table Scan ResultSet for XP_EFT_CONFIG at read committed isolation 
level using instantaneous share row locking chosen by the optimizer
Number of opens = 1
Rows seen = 12
Rows filtered = 0
Fetch Size = 16
        constructor time (milliseconds) = 0
        open time (milliseconds) = 0
        next time (milliseconds) = 0
        close time (milliseconds) = 0
        next time in milliseconds/row = 0

scan information: 
        Bit set of columns fetched=All
        Number of columns fetched=2
        Number of pages visited=2
        Number of rows qualified=12
        Number of rows visited=12
        Scan type=heap
        start position: 
null    stop position: 
null    qualifiers:
None
        optimizer estimated row count:           17.00
        optimizer estimated cost:           51.18
-------------------------------------------------------------------------------------



The other thing I would like to know 

if the property "derby.language.logQueryPlan" is set as true, then is derby 
vulerable to NPE ?


/**
         * @exception StandardException on error
         */     
        protected final void finishAndRTS() throws StandardException
        {

                if (!finished) {
                        /*
                        ** If run time statistics tracing is turned on, then 
now is the
                        ** time to dump out the information.
                        */
                        if (isTopResultSet) {

                                LanguageConnectionContext lcc = 
getLanguageConnectionContext();
                                if (lcc.getRunTimeStatisticsMode())
                                {
                                        endExecutionTime = 
getCurrentTimeMillis();

                                        lcc.setRunTimeStatisticsObject(
                                                
lcc.getExecutionContext().getResultSetStatisticsFactory().getRunTimeStatistics(activation,
 this, subqueryTrackingArray));

                                        HeaderPrintWriter istream = 
lcc.getLogQueryPlan() ? Monitor.getStream() : null;
                                        if (istream != null)
                                        {
                                                
istream.printlnWithHeader(LanguageConnectionContext.xidStr + 
                                                                                
                  lcc.getTransactionExecute().getTransactionIdString() +
                                                                                
                  "), " +
                                                                                
                  LanguageConnectionContext.lccStr +
                                                                                
                  lcc.getInstanceNumber() +
                                                                                
                  "), " +
                                                                                
                  lcc.getRunTimeStatisticsObject().getStatementText() + " 
******* " +
                                                                                
                  
lcc.getRunTimeStatisticsObject().getStatementExecutionPlanText());
                                        }
                                }

                        }

                        if (!isClosed())
                                close();

                        finished = true;

                        if (isTopResultSet && activation.isSingleExecution())
                                activation.close();
                }
        }


----------
The     if (lcc.getRunTimeStatisticsMode()) will get executed and it may throw 
NPE.
                                



> NPE at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finishAndRTS 
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-4794
>                 URL: https://issues.apache.org/jira/browse/DERBY-4794
>             Project: Derby
>          Issue Type: Bug
>          Components: Miscellaneous
>         Environment: Derby version info -- as seen in MANIFEST.MF
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.6.5
> Created-By: 1.4.2_12-b03 (Sun Microsystems Inc.)
> Bundle-Vendor: Apache Software Foundation
> Bundle-Name: Apache Derby 10.3
> Bundle-Version: 10.3.1000004.561794
> Sealed: true
>            Reporter: Manoranjan Sahu
>
> Derby is throwing NPE randomly while executing simple sql statements. 
> Stack trace in derby.log
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.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.ConnectionChild.handleException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
>       at 
> oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:726)
>       at 
> oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:501)
>       ... 58 more
> 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.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
>  Source)
>       ... 70 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finishAndRTS(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.finish(Unknown 
> Source)
>       at org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown 
> Source)
>       at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown 
> Source)
>       at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown 
> Source)
>       ... 63 more
> It is noticed that this issue is happening randomly , during selects and 
> inserts. I did not find any quick reproduction steps for it.

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

Reply via email to