[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3149) not catching NPE in final clause masks true exception
Randal Kamradt (JIRA)
noreply at atlassian.com
Fri Feb 29 19:27:33 EST 2008
not catching NPE in final clause masks true exception
-----------------------------------------------------
Key: HHH-3149
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3149
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.0.ga
Reporter: Randal Kamradt
In org.hibernate.id.insert.AbstractReturningDelegate
PreparedStatement insert = prepare( insertSQL, session );
try {
binder.bindValues( insert );
return executeAndExtract( insert );
}
finally {
releaseStatement( insert, session );
}
causes a NPE if prepare throws an exception. consider changing to:
PreparedStatement insert = prepare( insertSQL, session );
try {
binder.bindValues( insert );
return executeAndExtract( insert );
}
finally {
if(insert != null)
releaseStatement( insert, session );
}
this allows the true exception to be thrown so I can properly debug my code.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list