Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when closing getMetaData an a (closed) result set of a (closed) connection [JDBC469] #508

Closed
firebird-automations opened this issue Dec 21, 2016 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

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(AbstractConnection.java:224)
at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(FBResultSetMetaData.java:61)
at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(AbstractResultSet.java:1025)
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.gds.ng.FbExceptionBuilder$Type$1.createSQLException(FbExceptionBuilder.java:498)
at org.firebirdsql.gds.ng.FbExceptionBuilder$ExceptionInformation.toSQLException(FbExceptionBuilder.java:454)
at org.firebirdsql.gds.ng.FbExceptionBuilder.toSQLException(FbExceptionBuilder.java:218)
at org.firebirdsql.jdbc.FBConnection.getGDSHelper(FBConnection.java:1433)
at org.firebirdsql.jdbc.FBResultSetMetaData.isColumnLabelForName(FBResultSetMetaData.java:75)
at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(FBResultSetMetaData.java:64)
at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(AbstractResultSet.java:1098)

Commits: c060689 cef3c5c

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 3.0.0 [ 10440 ]

Fix Version: Jaybird 2.2.13 [ 10805 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

description: 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 might not throw an NPE (double check).

java.lang .NullPointerException
at org.firebirdsql.jdbc.AbstractConnection.getDatabaseParameterBuffer(AbstractConnection.java:224)
at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(FBResultSetMetaData.java:61)
at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(AbstractResultSet.java:1025)
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)

=>

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(AbstractConnection.java:224)
at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(FBResultSetMetaData.java:61)
at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(AbstractResultSet.java:1025)
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.gds.ng.FbExceptionBuilder$Type$1.createSQLException(FbExceptionBuilder.java:498)
at org.firebirdsql.gds.ng.FbExceptionBuilder$ExceptionInformation.toSQLException(FbExceptionBuilder.java:454)
at org.firebirdsql.gds.ng.FbExceptionBuilder.toSQLException(FbExceptionBuilder.java:218)
at org.firebirdsql.jdbc.FBConnection.getGDSHelper(FBConnection.java:1433)
at org.firebirdsql.jdbc.FBResultSetMetaData.isColumnLabelForName(FBResultSetMetaData.java:75)
at org.firebirdsql.jdbc.FBResultSetMetaData.<init>(FBResultSetMetaData.java:64)
at org.firebirdsql.jdbc.AbstractResultSet.getMetaData(AbstractResultSet.java:1098)

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

ResultSet.getMetaData() will now throw an SQLException when called on a closed result set.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 3.0.0-beta-3 [ 10806 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment