]
Ahmed Zaoui updated GTNPORTAL-3512:
-----------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request:
Don't swallow exception when happens on IDM API
-----------------------------------------------
Key: GTNPORTAL-3512
URL:
https://issues.jboss.org/browse/GTNPORTAL-3512
Project: GateIn Portal
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Affects Versions: 3.5.10.Final, 3.6.3.Final, 3.7.1.Final, 3.8.2.Final
Reporter: Boubaker Khanfir
The GateIN IDM implementation is a Data Management Layer Impl. Thus, the exceptions and
errors occurred in this level have to be thrown to upper layer. In fact, if we see what is
done in "recoverFromIDMError", we see that no exception is thrown after
"rollback" operation is done.
Let's take a simple example for this use case:
I have an API that :
# create a user.
# create a group.
# assign the user to this group.
# do some other initialization tasks for that user.
If, for example, I got an error in User creation operation, I will not be able to
"break" the complete operation. As workaround, I have to do the
"findUserByName", but this is not normal, because if the "saveUser"
operation fails, it should throw an exception so that I can handle it.
The modification in GateIN source code is simple: just add a "throw exception"
at the end of "recoverFromIDMError" method.