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 Eric Floehr <Er...@3x.com> on 2008/02/05 18:00:26 UTC

NullPointerException in Derby driver (from at least 10.2.2.0)

All,

 

I'm experiencing a NullPointerException (somewhat random) apparently
within the Derby JDBC driver (stack trace below), and am wondering if
anyone has any suggestions on finding the root cause.  I am using Derby
10.3.2.1 (though the problem also occurred on 10.2.2.0) with an IBATIS
front-end (version 2.3.1.700, though it also occurred with 2.2), using
Derby in single-user mode (direct not via server).

 

Here is the root stack trace:

 

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.wrapArgsForTransportAcr
ossDRDA(Unknown Source)

               ... 21 more

Caused by: java.lang.NullPointerException

               at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(U
nknown Source)

               at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(U
nknown Source)

               at
org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source)

               at
org.apache.derby.impl.store.access.btree.OpenBTree.init(Unknown Source)

               at
org.apache.derby.impl.store.access.btree.BTreeScan.init(Unknown Source)

               at
org.apache.derby.impl.store.access.btree.index.B2IForwardScan.init(Unkno
wn Source)

               at
org.apache.derby.impl.store.access.btree.index.B2I.openScan(Unknown
Source)

               at
org.apache.derby.impl.store.access.RAMTransaction.openScan(Unknown
Source)

               at
org.apache.derby.impl.store.access.RAMTransaction.openCompiledScan(Unkno
wn Source)

               at
org.apache.derby.impl.sql.execute.TableScanResultSet.openScanController(
Unknown Source)

               at
org.apache.derby.impl.sql.execute.TableScanResultSet.openScanController(
Unknown Source)

               at
org.apache.derby.impl.sql.execute.TableScanResultSet.openCore(Unknown
Source)

               at
org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.openCore(Un
known Source)

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

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

               ... 14 more

 

I appreciate any help or pointers you can provide!

 

Thanks much!

Eric

 


Re: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Stanley Bradbury <St...@gmail.com>.
Eric Floehr wrote:
>
> All,
>
> I’m experiencing a NullPointerException (somewhat random) apparently 
> within the Derby JDBC driver (stack trace below), and am wondering if 
> anyone has any suggestions on finding the root cause. I am using Derby 
> 10.3.2.1 (though the problem also occurred on 10.2.2.0) with an IBATIS 
> front-end (version 2.3.1.700, though it also occurred with 2.2), using 
> Derby in single-user mode (direct not via server).
>
> Here is the root stack trace:
>
> 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)
>
> ... 21 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.btree.OpenBTree.init(Unknown Source)
>
> at org.apache.derby.impl.store.access.btree.BTreeScan.init(Unknown Source)
>
> at 
> org.apache.derby.impl.store.access.btree.index.B2IForwardScan.init(Unknown 
> Source)
>
> at org.apache.derby.impl.store.access.btree.index.B2I.openScan(Unknown 
> Source)
>
> at org.apache.derby.impl.store.access.RAMTransaction.openScan(Unknown 
> Source)
>
> at 
> org.apache.derby.impl.store.access.RAMTransaction.openCompiledScan(Unknown 
> Source)
>
> at 
> org.apache.derby.impl.sql.execute.TableScanResultSet.openScanController(Unknown 
> Source)
>
> at 
> org.apache.derby.impl.sql.execute.TableScanResultSet.openScanController(Unknown 
> Source)
>
> at 
> org.apache.derby.impl.sql.execute.TableScanResultSet.openCore(Unknown 
> Source)
>
> at 
> org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.openCore(Unknown 
> Source)
>
> at 
> org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown 
> Source)
>
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown 
> Source)
>
> ... 14 more
>
> I appreciate any help or pointers you can provide!
>
> Thanks much!
>
> Eric
>
Hi Eric -
Is there any additional information provided in the derby.log file like 
the SQL that was being processed?
Does the failure happen at the same point when it does happen?
What JVM are you using? If it is not a JVM that was platform tested 
would it be possible for you to test with one that was? You can find a 
list on this page: 
http://wiki.apache.org/db-derby/TenThreeTwoPlatformTesting



RE: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Eric Floehr <Er...@3x.com>.
Jim,

Yes, I would say that is a reasonable work-around.  In our case, we
built the networking code, so we saw where the interrupt was being
handled but the flag not reset, so we were able to fix it at the source.
But barring that, resetting it prior to a derby write/commit should
work.

Regards,
Eric


> -----Original Message-----
> From: Jim Newsham [mailto:jnewsham@referentia.com]
> Sent: Wednesday, February 13, 2008 4:54 PM
> To: 'Derby Discussion'
> Subject: RE: NullPointerException in Derby driver (from at least
> 10.2.2.0)
> 
> 
> Thanks for the advice Eric.  It seems from DERBY-151 that calling
> Thread.interrupted() before calling commit() is a reasonable
workaround
> until the problem is fixed.  Is this your assessment?
> 
> Might also be desirable to save the result and re-interrupt afterwards
> if
> interrupt status must be preserved (which it generally should).
Though
> perhaps the same problem might be manifested in other parts of the
> driver.
> 
> Thanks,
> Jim
> 
> > -----Original Message-----
> > From: Eric Floehr [mailto:Eric.Floehr@3x.com]
> > Sent: Wednesday, February 13, 2008 11:39 AM
> > To: Derby Discussion
> > Subject: RE: NullPointerException in Derby driver (from at least
> 10.2.2.0)
> >
> > Jim,
> >
> > That's definitely what we are seeing, and our only option was to
> restart
> > the app as well.  You should really check the interrupt, because it
> > wasn't so much that InterruptedException was thrown at your code in
> the
> > thread for us.  What was happening is the interrupt flag was getting
> set
> > down in the network layer, the interrupt was successfully handled
> there,
> > but the interrupt flag was not getting cleared.  So then, next time
> > there was a commit on the database (in a totally separate part of
the
> > code) on that thread, we had the problem.
> >
> > -Eric
> >
> > > -----Original Message-----
> > > From: Jim Newsham [mailto:jnewsham@referentia.com]
> > > Sent: Wednesday, February 13, 2008 2:30 PM
> > > To: 'Derby Discussion'
> > > Subject: RE: NullPointerException in Derby driver (from at least
> > > 10.2.2.0)
> > >
> > >
> > > I have been seeing this same problem (very) intermittently as
> well...
> > > just
> > > have been way too busy with other things at the time to look into
> it.
> > > When
> > > it occurs, I generally see a NullPointerException on commit, and
> > > subsequent
> > > usage of the (statement? connection? data source? not sure
exactly)
> > > gives
> > > "No current connection" errors.  Our application needs to be
> restarted
> > > to
> > > recover, so I think the data source is no longer usable.
> > >
> > > This is with embedded 10.3.2.1.  Not sure if the thread is being
> > > interrupted
> > > in this case.  I think not, but could be wrong.
> > >
> > > Jim
> > >
> > > > -----Original Message-----
> > > > From: Daniel Noll [mailto:daniel@nuix.com]
> > > > Sent: Tuesday, February 05, 2008 6:17 PM
> > > > To: Derby Discussion
> > > > Subject: Re: NullPointerException in Derby driver (from at least
> > > 10.2.2.0)
> > > >
> > > > On Wednesday 06 February 2008 04:00:26 Eric Floehr wrote:
> > > > > All,
> > > > > I'm experiencing a NullPointerException (somewhat random)
> > > apparently
> > > > > within the Derby JDBC driver (stack trace below), and am
> wondering
> > > if
> > > > > anyone has any suggestions on finding the root cause.  I am
> using
> > > Derby
> > > > > 10.3.2.1 (though the problem also occurred on 10.2.2.0) with
an
> > > IBATIS
> > > > > front-end (version 2.3.1.700, though it also occurred with
> 2.2),
> > > using
> > > > > Derby in single-user mode (direct not via server).
> > > >
> > > > Interesting, I found exactly the same problem.  I'm not sure
> whether
> > > I
> > > > posted
> > > > about it to the list or whether I stayed quiet.
> > > >
> > > > Do you have another warning earlier in the log about the
> connection
> > > having
> > > > been closed?  The few times I've seen this, the connection has
> > > "closed
> > > > itself" (despite being embedded, and thus having no good reason
> > > to...) and
> > > > then I've seen these errors for all operations directly
> afterwards.
> > > >
> > > > Daniel
> > >
> > >
> >
> 
> 


RE: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Jim Newsham <jn...@referentia.com>.
Thanks for the advice Eric.  It seems from DERBY-151 that calling
Thread.interrupted() before calling commit() is a reasonable workaround
until the problem is fixed.  Is this your assessment?

Might also be desirable to save the result and re-interrupt afterwards if
interrupt status must be preserved (which it generally should).  Though
perhaps the same problem might be manifested in other parts of the driver.

Thanks,
Jim

> -----Original Message-----
> From: Eric Floehr [mailto:Eric.Floehr@3x.com]
> Sent: Wednesday, February 13, 2008 11:39 AM
> To: Derby Discussion
> Subject: RE: NullPointerException in Derby driver (from at least 10.2.2.0)
> 
> Jim,
> 
> That's definitely what we are seeing, and our only option was to restart
> the app as well.  You should really check the interrupt, because it
> wasn't so much that InterruptedException was thrown at your code in the
> thread for us.  What was happening is the interrupt flag was getting set
> down in the network layer, the interrupt was successfully handled there,
> but the interrupt flag was not getting cleared.  So then, next time
> there was a commit on the database (in a totally separate part of the
> code) on that thread, we had the problem.
> 
> -Eric
> 
> > -----Original Message-----
> > From: Jim Newsham [mailto:jnewsham@referentia.com]
> > Sent: Wednesday, February 13, 2008 2:30 PM
> > To: 'Derby Discussion'
> > Subject: RE: NullPointerException in Derby driver (from at least
> > 10.2.2.0)
> >
> >
> > I have been seeing this same problem (very) intermittently as well...
> > just
> > have been way too busy with other things at the time to look into it.
> > When
> > it occurs, I generally see a NullPointerException on commit, and
> > subsequent
> > usage of the (statement? connection? data source? not sure exactly)
> > gives
> > "No current connection" errors.  Our application needs to be restarted
> > to
> > recover, so I think the data source is no longer usable.
> >
> > This is with embedded 10.3.2.1.  Not sure if the thread is being
> > interrupted
> > in this case.  I think not, but could be wrong.
> >
> > Jim
> >
> > > -----Original Message-----
> > > From: Daniel Noll [mailto:daniel@nuix.com]
> > > Sent: Tuesday, February 05, 2008 6:17 PM
> > > To: Derby Discussion
> > > Subject: Re: NullPointerException in Derby driver (from at least
> > 10.2.2.0)
> > >
> > > On Wednesday 06 February 2008 04:00:26 Eric Floehr wrote:
> > > > All,
> > > > I'm experiencing a NullPointerException (somewhat random)
> > apparently
> > > > within the Derby JDBC driver (stack trace below), and am wondering
> > if
> > > > anyone has any suggestions on finding the root cause.  I am using
> > Derby
> > > > 10.3.2.1 (though the problem also occurred on 10.2.2.0) with an
> > IBATIS
> > > > front-end (version 2.3.1.700, though it also occurred with 2.2),
> > using
> > > > Derby in single-user mode (direct not via server).
> > >
> > > Interesting, I found exactly the same problem.  I'm not sure whether
> > I
> > > posted
> > > about it to the list or whether I stayed quiet.
> > >
> > > Do you have another warning earlier in the log about the connection
> > having
> > > been closed?  The few times I've seen this, the connection has
> > "closed
> > > itself" (despite being embedded, and thus having no good reason
> > to...) and
> > > then I've seen these errors for all operations directly afterwards.
> > >
> > > Daniel
> >
> >
> 




RE: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Eric Floehr <Er...@3x.com>.
Jim,

That's definitely what we are seeing, and our only option was to restart
the app as well.  You should really check the interrupt, because it
wasn't so much that InterruptedException was thrown at your code in the
thread for us.  What was happening is the interrupt flag was getting set
down in the network layer, the interrupt was successfully handled there,
but the interrupt flag was not getting cleared.  So then, next time
there was a commit on the database (in a totally separate part of the
code) on that thread, we had the problem.

-Eric

> -----Original Message-----
> From: Jim Newsham [mailto:jnewsham@referentia.com]
> Sent: Wednesday, February 13, 2008 2:30 PM
> To: 'Derby Discussion'
> Subject: RE: NullPointerException in Derby driver (from at least
> 10.2.2.0)
> 
> 
> I have been seeing this same problem (very) intermittently as well...
> just
> have been way too busy with other things at the time to look into it.
> When
> it occurs, I generally see a NullPointerException on commit, and
> subsequent
> usage of the (statement? connection? data source? not sure exactly)
> gives
> "No current connection" errors.  Our application needs to be restarted
> to
> recover, so I think the data source is no longer usable.
> 
> This is with embedded 10.3.2.1.  Not sure if the thread is being
> interrupted
> in this case.  I think not, but could be wrong.
> 
> Jim
> 
> > -----Original Message-----
> > From: Daniel Noll [mailto:daniel@nuix.com]
> > Sent: Tuesday, February 05, 2008 6:17 PM
> > To: Derby Discussion
> > Subject: Re: NullPointerException in Derby driver (from at least
> 10.2.2.0)
> >
> > On Wednesday 06 February 2008 04:00:26 Eric Floehr wrote:
> > > All,
> > > I'm experiencing a NullPointerException (somewhat random)
> apparently
> > > within the Derby JDBC driver (stack trace below), and am wondering
> if
> > > anyone has any suggestions on finding the root cause.  I am using
> Derby
> > > 10.3.2.1 (though the problem also occurred on 10.2.2.0) with an
> IBATIS
> > > front-end (version 2.3.1.700, though it also occurred with 2.2),
> using
> > > Derby in single-user mode (direct not via server).
> >
> > Interesting, I found exactly the same problem.  I'm not sure whether
> I
> > posted
> > about it to the list or whether I stayed quiet.
> >
> > Do you have another warning earlier in the log about the connection
> having
> > been closed?  The few times I've seen this, the connection has
> "closed
> > itself" (despite being embedded, and thus having no good reason
> to...) and
> > then I've seen these errors for all operations directly afterwards.
> >
> > Daniel
> 
> 


RE: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Jim Newsham <jn...@referentia.com>.
I have been seeing this same problem (very) intermittently as well... just
have been way too busy with other things at the time to look into it.  When
it occurs, I generally see a NullPointerException on commit, and subsequent
usage of the (statement? connection? data source? not sure exactly) gives
"No current connection" errors.  Our application needs to be restarted to
recover, so I think the data source is no longer usable.

This is with embedded 10.3.2.1.  Not sure if the thread is being interrupted
in this case.  I think not, but could be wrong.

Jim

> -----Original Message-----
> From: Daniel Noll [mailto:daniel@nuix.com]
> Sent: Tuesday, February 05, 2008 6:17 PM
> To: Derby Discussion
> Subject: Re: NullPointerException in Derby driver (from at least 10.2.2.0)
> 
> On Wednesday 06 February 2008 04:00:26 Eric Floehr wrote:
> > All,
> > I'm experiencing a NullPointerException (somewhat random) apparently
> > within the Derby JDBC driver (stack trace below), and am wondering if
> > anyone has any suggestions on finding the root cause.  I am using Derby
> > 10.3.2.1 (though the problem also occurred on 10.2.2.0) with an IBATIS
> > front-end (version 2.3.1.700, though it also occurred with 2.2), using
> > Derby in single-user mode (direct not via server).
> 
> Interesting, I found exactly the same problem.  I'm not sure whether I
> posted
> about it to the list or whether I stayed quiet.
> 
> Do you have another warning earlier in the log about the connection having
> been closed?  The few times I've seen this, the connection has "closed
> itself" (despite being embedded, and thus having no good reason to...) and
> then I've seen these errors for all operations directly afterwards.
> 
> Daniel




RE: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Eric Floehr <Er...@3x.com>.
Dyre,

We have done some more investigation and the issue appears triggered
when Derby does a page write on a commit on a thread which has the
interrupt flag set.  We believe that existing bug 151 is the likely root
of the issue, and we have posted our comments there.  Let me know what
you think.

https://issues.apache.org/jira/browse/DERBY-151

-Eric


> -----Original Message-----
> From: Dyre.Tjeldvoll@Sun.COM [mailto:Dyre.Tjeldvoll@Sun.COM]
> Sent: Tuesday, February 12, 2008 6:56 AM
> To: Derby Discussion
> Subject: Re: NullPointerException in Derby driver (from at least
> 10.2.2.0)
> 
> Eric Floehr <Er...@3x.com> writes:
> 
> > Daniel,
> >
> > Yes, we see that as well, but not always.  Following is the stack
> trace of that.  Did you ever find the solution to the problem?  Thanks
> so much!
> >
> > SQL Error code: 40000
> > SQL State: 08003
> > java.sql.SQLNonTransientConnectionException: No current connection.
> > 	at
>
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknow
> n Source)
> > 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
> Source)
> > 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
> Source)
> > 	at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown
> Source)
> > 	at
> org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown
> Source)
> > 	at
> org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown
> Source)
> > 	at org.apache.derby.impl.jdbc.EmbedConnection.rollback(Unknown
> Source)
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> > 	at java.lang.reflect.Method.invoke(Unknown Source)
> > 	at
>
com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(S
> impleDataSource.java:958)
> > 	at $Proxy5.rollback(Unknown Source)
> > 	at
>
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.rollback(Jdbc
> Transaction.java:72)
> > 	at
>
com.ibatis.sqlmap.engine.transaction.TransactionManager.end(Transaction
> Manager.java:87)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(Sql
> MapExecutorDelegate.java:724)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSe
> ssionImpl.java:176)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapCli
> entImpl.java:153)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction
> (SqlMapExecutorDelegate.java:825)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecu
> torDelegate.java:400)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImp
> l.java:82)
> > 	at
>
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.
> java:58)
> > 	at com.<our code>
> > 	at com.<our code>
> > 	at com.<our code>
> > 	at java.lang.Thread.run(Unknown Source)
> > Caused by: java.sql.SQLException: No current connection.
> > 	at
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
> Source)
> > 	at
>
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAc
> rossDRDA(Unknown Source)
> > 	... 26 more
> >
> 
> Seems like a bug to me. Unless someone can point to an existing Jira
> for
> this I think it would be good to create one.
> 
> --
> dt

Re: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Dy...@Sun.COM.
Eric Floehr <Er...@3x.com> writes:

> Daniel,
>
> Yes, we see that as well, but not always.  Following is the stack trace of that.  Did you ever find the solution to the problem?  Thanks so much!
>
> SQL Error code: 40000
> SQL State: 08003
> java.sql.SQLNonTransientConnectionException: No current connection.
> 	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.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.rollback(Unknown Source)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:958)
> 	at $Proxy5.rollback(Unknown Source)
> 	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.rollback(JdbcTransaction.java:72)
> 	at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(TransactionManager.java:87)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:724)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:176)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:153)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:825)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:400)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
> 	at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
> 	at com.<our code>
> 	at com.<our code>
> 	at com.<our code>
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.sql.SQLException: No current connection.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
> 	... 26 more
>

Seems like a bug to me. Unless someone can point to an existing Jira for
this I think it would be good to create one.

-- 
dt

RE: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Eric Floehr <Er...@3x.com>.
Daniel,

Yes, we see that as well, but not always.  Following is the stack trace of that.  Did you ever find the solution to the problem?  Thanks so much!

SQL Error code: 40000
SQL State: 08003
java.sql.SQLNonTransientConnectionException: No current connection.
	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.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.rollback(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:958)
	at $Proxy5.rollback(Unknown Source)
	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.rollback(JdbcTransaction.java:72)
	at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(TransactionManager.java:87)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:724)
	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:176)
	at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:153)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:825)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:400)
	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
	at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
	at com.<our code>
	at com.<our code>
	at com.<our code>
	at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: No current connection.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
	... 26 more


-Eric


> -----Original Message-----
> From: Daniel Noll [mailto:daniel@nuix.com]
> Sent: Tuesday, February 05, 2008 11:17 PM
> To: Derby Discussion
> Subject: Re: NullPointerException in Derby driver (from at least
> 10.2.2.0)
> 
> Interesting, I found exactly the same problem.  I'm not sure whether I
> posted
> about it to the list or whether I stayed quiet.
> 
> Do you have another warning earlier in the log about the connection
> having
> been closed?  The few times I've seen this, the connection has "closed
> itself" (despite being embedded, and thus having no good reason to...)
> and
> then I've seen these errors for all operations directly afterwards.
> 
> Daniel

Re: NullPointerException in Derby driver (from at least 10.2.2.0)

Posted by Daniel Noll <da...@nuix.com>.
On Wednesday 06 February 2008 04:00:26 Eric Floehr wrote:
> All,
> I'm experiencing a NullPointerException (somewhat random) apparently
> within the Derby JDBC driver (stack trace below), and am wondering if
> anyone has any suggestions on finding the root cause.  I am using Derby
> 10.3.2.1 (though the problem also occurred on 10.2.2.0) with an IBATIS
> front-end (version 2.3.1.700, though it also occurred with 2.2), using
> Derby in single-user mode (direct not via server).

Interesting, I found exactly the same problem.  I'm not sure whether I posted 
about it to the list or whether I stayed quiet.

Do you have another warning earlier in the log about the connection having 
been closed?  The few times I've seen this, the connection has "closed 
itself" (despite being embedded, and thus having no good reason to...) and 
then I've seen these errors for all operations directly afterwards.

Daniel