Bug 886850
Summary: | 4.6 on as7: different rollback semantic for Exceptions | ||
---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Heiko W. Rupp <hrupp> |
Component: | Core Server | Assignee: | Jay Shaughnessy <jshaughn> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 4.5 | CC: | hrupp, jshaughn |
Target Milestone: | --- | ||
Target Release: | RHQ 4.6 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-09-03 14:46:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Heiko W. Rupp
2012-12-13 11:17:42 UTC
I confirmed this behavior and can only conclude that 4.2.3 did not handle these exceptions correctly, whereas AS7 is behaving as per the spec. After some discussion, the approach we'll take is to do what Heiko mentions above and annotate the exception class with @ApplicationException(rollback="false"), while leaving it a RuntimeException. This will basically maintain the previous behavior, which we think is the intended behavior. In general, we want these exceptions to provide information while not necessarily causing failure of an ongoing transaction. It can be wrapped and/or rethrown as necessary by a caller, if necessary. Also, this affects several other Exception classes. I'll have to go through the various classes and uses to ensure we're getting this right... master commit c29e6ace53f377cbc25349524265c3c5e59180ad Author: Jay Shaughnessy <jshaughn> Date: Fri Jan 4 09:07:25 2013 -0500 It seems AS 4.2.3 did not wrap RuntimeExceptions as EJBExceptions as per the spec. Neither did it rollback a supported transaction. Furthermore, RHQ code was written assuming the bad semantics were correct. AS7 corrects the handling and therefore the RHQ code is now in error in certain places. AS 4.2.3 basically treated the RuntimeException as an ApplicationException. This commit tries to get sime consistency around our Exception classes that should be treated this way. It adds the @ApplicationException annotation to several classes, and a few others are changed from extending Exception to extending RuntimeException as well as then being annotated. A test has been added that ensures handling of the relevant exception classes works as expected, as an ApplicationException that is not wrapped and does not rollback a supported transaction. Also: - revert changes to UserHandlerBean to work around the problem reported in this BZ - fix catch statement in ResourceOperationJob to catch thre ApplicationException, not the wrapped EJBException - fix issue in OperationManagerBean to throw the proper ApplicationException Test Notes ---------- This is an implicit change that is not easily explicitly tested. As long as the REST API tests, and server itests, are passing that is probably sufficient. Heiko, please review this commit and make sure you're satisfied. Thanks, Jay. Jay, thanks for looking into that. Your code broke some code in the REST-tests, which means your code is ok, as that breakage was expected in case of making the change. I've updated the server code in master c2a76f6412366703 accordingly. Bulk closing of issues in old RHQ releases that are in production for a while now. Please open a new issue when running into an issue. |