Merge pull request #2148 from mposolda/master

KEYCLOAK-2235 Fix possible transaction leak at startup with add-user
This commit is contained in:
Marek Posolda 2016-02-01 22:23:43 +01:00
commit 8ad8a3fbac

View file

@ -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();