Issue Details (XML | Word | Printable)

Key: JDBC-469
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JDBC Driver

NullPointerException when closing `getMetaData` an a (closed) result set of a (closed) connection

Created: 21/Dec/16 01:35 PM   Updated: 05/Mar/17 12:59 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.2.9, Jaybird 2.2.10, Jaybird 2.2.11, Jaybird 2.2.12, Jaybird 3.0.0-alpha-1, Jaybird 3.0.0-beta-1, Jaybird 3.0.0-beta-2
Fix Version/s: Jaybird 3.0.0-beta-3, Jaybird 2.2.13, Jaybird 3.0.0

 Description  « Hide
When calling `ResultSet.getMetaData()` on a (closed) result set of a (closed) connection a NPE can occur. Instead it should throw an exception that the result set is closed.

Exception below is in 2.2.12, Jaybird 3 has a similar problem, but it does not throw an NullPointerException.

java.lang .NullPointerException
    at org.firebirdsql.jdbc.AbstractConnection.getDatabaseParameterBuffer(
    at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(
    at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(
    at com.borland.dx.sql.dataset.RuntimeMetaData.a(Unknown Source)
    at com.borland.dx.sql.dataset.JdbcProvider.b(Unknown Source)
    at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
    at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
    at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)

Exception in Jaybird 3.0.0-beta-2 is:

java.sql.SQLException: no transaction for request [SQLState:25000, ISC error code:335544363]
at org.firebirdsql.jdbc.FBConnection.getGDSHelper(
at org.firebirdsql.jdbc.FBResultSetMetaData.isColumnLabelForName(
at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(
at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 24/Dec/16 12:39 PM
ResultSet.getMetaData() will now throw an SQLException when called on a closed result set.