lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

V1.1.114(2009-06-01): NullPointerException in JDBCConnection line 127 #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I can reproduce it every time but cannot yet provide a small test-case
that is easy to set up.

NullPointerException in
org.h2.jdbc.JdbcConnection.<init> line 127 (connection==null)
from: JdbcXAConnection$PooledJdbcConnection.<init> line 481 (does not do
anything)
from: JdbcXAConnection.getConnection() line 122

Strange thing is: in JdbcXAConnection the connection is created 1 line
before the call, thus it can never be null.

Marcus

Original issue reported on code.google.com by Suran...@gmail.com on 2 Jun 2009 at 11:50

GoogleCodeExporter commented 9 years ago
I deleted the 4 local embedded-databases and started to fill  them again.
The issue was gone.
...strange.
(Sorry for the duplicate bug. google gave an error-message so I resent my
HTTP-request to not loose the typed text.)

The LoginTimeout is there again (after inserting the first 50 rows to a new 
table, 10
connections open at that time.). No clue yet about why.

Original comment by Suran...@gmail.com on 2 Jun 2009 at 12:06

GoogleCodeExporter commented 9 years ago
Ok. LoginTimeout is found. It was waiting until the timeout for any of the 10
connections to be closed as maxconnections=10 . Has nothing to do with the
reported NullPointerException.

Does the 1.1.114 sources match the .jar -file contained in the zip?
I can't explain how that particular exception with that stack-trace
was possible any other way.

Original comment by Suran...@gmail.com on 2 Jun 2009 at 12:11

GoogleCodeExporter commented 9 years ago
The NullPointerException just happened again.

This time a short time after an Exception 
"Database is already closed" occuring in
PooledJdbcConnection.checkClosed()
in a JdbcPreparedStatement.
However before that statement was created and filled 2 lines ago
we did a check for connection.isClosed().

Original comment by Suran...@gmail.com on 2 Jun 2009 at 12:21

GoogleCodeExporter commented 9 years ago
I found the cause of the NullPointerException.

There was a Connection-leak (sometimes connections where not closed)
in the application.
After I fixed it this NullPointerException seems to be gone.
However, it should not have been there at all.
The cause of this NullPointer still remains a mystery.

Also with the LoginTimeout: When #connections>maxconnections
H2 would wait for a connection to be closed and gives a LoginTimeout-Exception.
The user has no way to know that this is because there are too many
open connections. It should catch the LoginTimeout-Exception and throw
a MaxConnectionsReached or similar so the user knows what he/she has to
do. (Patch is trivial and thus not attached.)

Original comment by Suran...@gmail.com on 3 Jun 2009 at 5:40

GoogleCodeExporter commented 9 years ago
Please post a reproducible test case

Original comment by thomas.t...@gmail.com on 4 Jun 2009 at 7:22

GoogleCodeExporter commented 9 years ago
I will close this bug for now. If you have a reproducible test case,
please post it - I will then re-open the bug.

Original comment by thomas.t...@gmail.com on 13 Jun 2009 at 8:00