Merge pull request #2318 from stianst/KEYCLOAK-2577
KEYCLOAK-2577 Rollback session in KeycloakSessionServletFilter if not…
This commit is contained in:
commit
2bf3531c43
1 changed files with 6 additions and 0 deletions
|
@ -77,6 +77,12 @@ public class KeycloakSessionServletFilter implements Filter {
|
|||
try {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} finally {
|
||||
// KeycloakTransactionCommitter is responsible for committing the transaction, but if an exception is thrown it's not invoked and transaction
|
||||
// should be rolled back
|
||||
if (session.getTransaction() != null && session.getTransaction().isActive()) {
|
||||
session.getTransaction().rollback();
|
||||
}
|
||||
|
||||
session.close();
|
||||
ResteasyProviderFactory.clearContextData();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue