--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/19d05ed6-0b7b-4be6-a209-734ea6b572abn%40googlegroups.com.
We doesn't, do anything special for these classes exception annotating them with @jakarta.inject.CacheableIn persistence.xml we do set the property hibernate.cache.use_second_level_cache to true.We also include <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
The unusual part of our setup is our usage of skinny wars and the fact that the jpa jar is shared within the jar. Multiple threads doing initialization isn't necessarily a problem here the problem is that the initialization isn't thread safe. The check for cache being uninitialized and the initialization of it must be done as an atomic operation, if infinispan doesn't provide such functionality, then hibernate should at least protect its own state.
Can you hack together a reproducer that I could run? Perhaps you
can build the ear without any classes and see if the problem still
occurs.
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="ptsmc" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<non-jta-data-source>java:jboss/example</non-jta-data-source>
<!-- START GENERATED BLOCK. DO NOT EDIT INSIDE -->
<class>org.example.CtrlProperty</class>
<class>org.example.CtrlPropertyMeta</class>
<!-- END GENERATED BLOCK. DO NOT EDIT INSIDE -->
<class>org.example.BooleanXConverter</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>
<property name="hibernate.archive.scanner" value="org.hibernate.boot.archive.scan.internal.DisabledScanner"/>
<property name="hibernate.connection.autocommit" value="false"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
</properties>
</persistence-unit>
</persistence>