Cleaning up threadlocals to prevent (small) memory leak

Closes #43759

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
This commit is contained in:
Alexander Schwartz 2025-10-28 14:36:27 +01:00 committed by GitHub
parent b537fc954a
commit ba0fe9bd70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -253,6 +253,8 @@ public class LiquibaseJpaUpdaterProvider implements JpaUpdaterProvider {
}
} catch (LiquibaseException e) {
throw new RuntimeException("Failed to validate database", e);
} finally {
ThreadLocalSessionContext.removeCurrentSession();
}
return Status.VALID;

View File

@ -251,6 +251,8 @@ public class QuarkusJpaUpdaterProvider implements JpaUpdaterProvider {
}
} catch (LiquibaseException e) {
throw new RuntimeException("Failed to validate database", e);
} finally {
ThreadLocalSessionContext.removeCurrentSession();
}
return Status.VALID;