-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
NPE when ResultSet is null #492
Comments
+1 |
Hi, It should be fixed in the latest 3.4.0-SNAPSHOT. Regards, |
Hi, @vladchuk |
harawata
added a commit
that referenced
this issue
Nov 14, 2017
pulllock
pushed a commit
to pulllock/mybatis-3
that referenced
this issue
Oct 19, 2023
…meterIndex) returned null.
pulllock
pushed a commit
to pulllock/mybatis-3
that referenced
this issue
Oct 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the DefaultResultSetHandler, where rs is null (Oracle returns null RS in certain cases), a nasty NP exception is thrown (in the ResultSetWrapper) below:
private void handleRefCursorOutputParameter(ResultSet rs, ParameterMapping parameterMapping, MetaObject metaParam) throws SQLException {
try {
final String resultMapId = parameterMapping.getResultMapId();
final ResultMap resultMap = configuration.getResultMap(resultMapId);
final DefaultResultHandler resultHandler = new DefaultResultHandler(objectFactory);
final ResultSetWrapper rsw = new ResultSetWrapper(rs, configuration);
handleRowValues(rsw, resultMap, resultHandler, new RowBounds(), null);
metaParam.setValue(parameterMapping.getProperty(), resultHandler.getResultList());
} finally {
// issue #228 (close resultsets)
closeResultSet(rs);
}
}
It would be nice to have a check, something like:
if (rs != null) {
final ResultSetWrapper rsw = new ResultSetWrapper(rs, configuration);
handleRowValues(rsw, resultMap, rh, new RowBounds(), null);
}
Please fix or suggest a workaround - this really makes it impossible for us to use mybatis.
The text was updated successfully, but these errors were encountered: