History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RHQ-1117
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Ian Springer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RHQ Project

error handling code for SQLExceptions during metric/trait insertion does not log root cause on Oracle (and Postgres code should log more too)

Created: 13/Nov/08 11:31 AM   Updated: 13/Nov/08 11:44 AM
Component/s: FX - Measurement, Core Server
Affects Version/s: 1.1.2
Fix Version/s: 1.2

Time Tracking:
Original Estimate: 3 hours
Original Estimate - 3 hours
Remaining Estimate: 3 hours
Remaining Estimate - 3 hours
Time Spent: Not Specified
Remaining Estimate - 3 hours

Issue Links:
Relation
 

VCS Revision: 1,960


 Description  « Hide
Here's an example of what is logged w/ Oracle:

2008-11-14 15:41:17,244 WARN [org.rhq.enterprise.server.measurement.MeasurementDataManagerBean] Failure saving measurement data:
ORA-01401: inserted value too large for column

This error message is useless, because it doesn't tell us which column has the issue.

Here's the error handling code:

       } catch (SQLException e) {
           log.warn("Failure saving measurement data:n" + e.getMessage());
           if ((dbType != null) && DatabaseTypeFactory.isPostgres(dbType)) {
               SQLException next = e.getNextException();
               log.warn(" +-> n" + next.getMessage());
           }
       }

Notice, for some reason, we only print the cause exception for Postgres, but not for Oracle. In addition to printing the cause exception(s), we should probably print the entire stack trace when DEBUG logging is turned on.

NOTE: This error handling code needs to be fixed in two places in MeasurementDataManagerBean:

addNumericData()
   -and-
addTraitData()


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.