Merge pull request #2148 from mposolda/master
KEYCLOAK-2235 Fix possible transaction leak at startup with add-user
This commit is contained in:
commit
8ad8a3fbac
1 changed files with 1 additions and 0 deletions
|
@ -326,6 +326,7 @@ public class KeycloakApplication extends Application {
|
|||
session.getTransaction().commit();
|
||||
logger.addUserSuccess(userRep.getUsername(), realmRep.getRealm());
|
||||
} catch (ModelDuplicateException e) {
|
||||
session.getTransaction().rollback();
|
||||
logger.addUserFailedUserExists(userRep.getUsername(), realmRep.getRealm());
|
||||
} catch (Throwable t) {
|
||||
session.getTransaction().rollback();
|
||||
|
|
Loading…
Reference in a new issue