Bug 54458 - DataSourceRealm should provide more info on SQLException
Summary: DataSourceRealm should provide more info on SQLException
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.34
Hardware: PC Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 21:56 UTC by mkbucc
Modified: 2013-01-23 15:57 UTC (History)
0 users



Attachments
Patch proposal (1.52 KB, patch)
2013-01-22 20:07 UTC, Violeta Georgieva
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mkbucc 2013-01-21 21:56:02 UTC
The getPassword() method of the DataSourceRealm does not log enough information when it encounters an SQL error.  The catch block is:

        } catch(SQLException e) {
            containerLog.error(
                    sm.getString("dataSourceRealm.getPassword.exception",
                                 username));
        } finally {

it would be really helpful to have some details of what the SQLException is.  I am getting this intermittently, and have resorted to subclassing getPassword() in an attempt to figure out what is going wrong.
Comment 1 Violeta Georgieva 2013-01-22 20:07:54 UTC
Created attachment 29883 [details]
Patch proposal

+1

Information for SQLException can be provided for methods:
- getPassword(Connection, String)
- getRoles(Connection, String)
Comment 2 Mark Thomas 2013-01-23 15:57:56 UTC
Thanks for the patch. It has been applied to trunk and 7.0.x and will be included in 7.0.36 onwards.