Remove DbActionExecutionException#1956
Conversation
| throw new RuntimeException("unexpected action"); | ||
| } | ||
| } catch (Exception e) { | ||
| } catch (RuntimeException e) { |
There was a problem hiding this comment.
It seems to me that we should revisit our exception handling. DbActionExecutionException doesn't seem particularly useful to the final application whereas it might be useful for our own internals.
There was a problem hiding this comment.
@mp911de Yeah... But this is not a part of this issue. Maybe we can create another issue to revise the default exception to be thrown? Or what should we do?
There was a problem hiding this comment.
The problem is that we're throwing DbActionExecutionException and not a DAO exception, so I think that is indeed part of the issue. Looking at the code, we do not catch DbActionExecutionException. That exception was introduced as part of introducing better means for debugging (#382) while the net effect was that we changed the API experience. What we could do is add DbActionExecutionException as suppressed exception to the original one.
Paging @schauder.
There was a problem hiding this comment.
I'm not sure what you mean by "adding as suppresed exception".
In my understanding Surpressed exceptions are ones that get lost when a finalizer throws an exception itself.
We could instantiate a new exception with the same type as the original with the additional information of the DAEE, or even the DAEE as cause. That would certainly look strange, but might actually be rather useful.
There was a problem hiding this comment.
Something along the lines of:
catch(RuntimeException e) {
e.addSuppressed(new DbActionExecutionException(action));
throw e;
}
There was a problem hiding this comment.
I didn't know addSuppressed. It is a little hackish, but seems fine to me. It's not worse then the other variants I had in mind.
ba1f4f0 to
a8fbd8f
Compare
|
I'm still not happy with this.
I see two possible ways forward: b) Implement a @mp911de What do you think? |
|
I would honestly drop Going forward, I would even suggest introducing |
|
Just to clarify what wasn't clear to me from Marks statement: For this PR we want to completely drop the The MyBatis integration should eventually also get its |
|
What I wrote above, was the result of a discussion with Mark, so please go ahead. |
|
Understood @schauder. Will complete shortly |
6532a21 to
13673aa
Compare
|
Because we're removing the Or maybe we can do better - we can just deprecate the |
|
It's not just about the existence of |
|
I agree with you @schauder. I'm just pointing out that retaining the Maybe just removing it entirely and not retaining the legacy in the next major version is a good way to go. Thanks! |
|
I see your idea, but if someone is referencing |
|
This PR has test failures in |
Signed-off-by: mipo256 <mikhailpolivakha@gmail.com>
|
Fixed the concurrency tests in |
|
Thanks for pushing this forward. I applied some polishing and some fixes to SQL scripts and merged it into 4.0.x |
Targeting #831 issue
CC: @schauder @mp911de