Upgrade to latest Infinispan version 14.0.8

Closes #20067
This commit is contained in:
Alexander Schwartz 2023-05-02 09:26:47 +02:00 committed by Michal Hajas
parent a10d511b12
commit c2c5012cfb
4 changed files with 11 additions and 12 deletions

View file

@ -18,7 +18,6 @@
package org.keycloak.models.sessions.infinispan.initializer; package org.keycloak.models.sessions.infinispan.initializer;
import org.infinispan.Cache; import org.infinispan.Cache;
import org.infinispan.commons.CacheConfigurationException;
import org.infinispan.commons.CacheException; import org.infinispan.commons.CacheException;
import org.infinispan.factories.ComponentRegistry; import org.infinispan.factories.ComponentRegistry;
import org.infinispan.manager.ClusterExecutor; import org.infinispan.manager.ClusterExecutor;
@ -63,12 +62,12 @@ public class InfinispanCacheInitializer extends BaseCacheInitializer {
@Override @Override
public void initCache() { public void initCache() {
final ComponentRegistry cr = this.workCache.getAdvancedCache().getComponentRegistry(); // due to lazy initialization, this might be called from multiple threads simultaneously, therefore, synchronize
try { synchronized (workCache) {
cr.registerComponent(sessionFactory, KeycloakSessionFactory.class); final ComponentRegistry cr = this.workCache.getAdvancedCache().getComponentRegistry();
} catch (UnsupportedOperationException | CacheConfigurationException ex) { // first check if already set, as Infinispan would otherwise throw a RuntimeException
if (cr.getComponent(KeycloakSessionFactory.class) != sessionFactory) { if (cr.getComponent(KeycloakSessionFactory.class) != sessionFactory) {
throw ex; cr.registerComponent(sessionFactory, KeycloakSessionFactory.class);
} }
} }
} }

View file

@ -81,8 +81,8 @@
<jakarta.persistence.version>2.2.3</jakarta.persistence.version> <jakarta.persistence.version>2.2.3</jakarta.persistence.version>
<hibernate-orm.version>6.2.1.Final</hibernate-orm.version> <hibernate-orm.version>6.2.1.Final</hibernate-orm.version>
<hibernate.c3p0.version>${hibernate-orm.version}</hibernate.c3p0.version> <hibernate.c3p0.version>${hibernate-orm.version}</hibernate.c3p0.version>
<infinispan.version>14.0.7.Final</infinispan.version> <infinispan.version>14.0.8.Final</infinispan.version>
<infinispan.protostream.processor.version>4.6.0.Final</infinispan.protostream.processor.version> <infinispan.protostream.processor.version>4.6.2.Final</infinispan.protostream.processor.version>
<jackson.version>2.14.2</jackson.version> <jackson.version>2.14.2</jackson.version>
<jackson.databind.version>2.14.2</jackson.databind.version> <jackson.databind.version>2.14.2</jackson.databind.version>
<jackson.annotations.version>${jackson.version}</jackson.annotations.version> <jackson.annotations.version>${jackson.version}</jackson.annotations.version>

View file

@ -18,8 +18,8 @@
<infinispan <infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:11.0 http://www.infinispan.org/schemas/infinispan-config-11.0.xsd" xsi:schemaLocation="urn:infinispan:config:14.0 http://www.infinispan.org/schemas/infinispan-config-14.0.xsd"
xmlns="urn:infinispan:config:11.0"> xmlns="urn:infinispan:config:14.0">
<cache-container name="keycloak"> <cache-container name="keycloak">
<transport lock-timeout="60000"/> <transport lock-timeout="60000"/>

View file

@ -18,8 +18,8 @@
<infinispan <infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:11.0 http://www.infinispan.org/schemas/infinispan-config-11.0.xsd" xsi:schemaLocation="urn:infinispan:config:14.0 http://www.infinispan.org/schemas/infinispan-config-14.0.xsd"
xmlns="urn:infinispan:config:11.0"> xmlns="urn:infinispan:config:14.0">
<cache-container name="keycloak"> <cache-container name="keycloak">
<local-cache name="default"> <local-cache name="default">