Community
Participate
Working Groups
Build Identifier: In our project we validate data integrity in a preCommit hook. When users of our application validate a business rule, the commit should fail, we give them an error message, and they can correct their mistake and try again. This is implemented by our preCommit hook throwing a subclass of RuntimeException. UnitOfWorkImpl.commitTransactionAfterWritesChanges catches every RuntimeException, rolls back the transaction (good) and logs the exception as a warning (should not be done). This logging of the exception as a warning, causes a log warning message every time a user violates a data integrity rule, which is normal behavior for the application. The warnings unnecessarily clog up the log and give the application administrator the impression that something went wrong, while nothing did go wrong. What would be best, is if it is configurable which type of exceptions produce a warning (for example an exception that the database is unavailable) and which exceptions should be logged at finest (debug) level (for example data integrity rule violations caused by end user mistakes). Reproducible: Always Steps to Reproduce: 1. define a preCommit hook that throws an exception 2. ensure that UnitOfWorkImpl.commitTransactionAfterWritesChanges is called 3. verify that an EclipseLink log message of severity WARN is produced
Workaround: define a custom logger in which you catch log messages of type WARN, check if they have an Exception, and if the type of exception is for a violated data integrity rule, change the log level. Though I am not sure if all those messages would come from commit time.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink