Skip to content

Commit

Permalink
SAK-41390 Add Apache Ignite as Spring jCache/Hibernate provider (saka…
Browse files Browse the repository at this point in the history
…iproject#7813)

* SAK-41390 Apache Ignite cache provider

* SAK-41390 Remove hibernate ehcache and update tests

* SAK-41390 Add Spring jCache
  • Loading branch information
ern authored Jun 9, 2020
1 parent 9938eb2 commit f1a6b67
Showing 53 changed files with 457 additions and 134 deletions.
5 changes: 0 additions & 5 deletions assignment/impl/pom.xml
Original file line number Diff line number Diff line change
@@ -114,11 +114,6 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ public Properties hibernateProperties() {
setProperty(org.hibernate.cfg.Environment.DIALECT, environment.getProperty(org.hibernate.cfg.Environment.DIALECT, HSQLDialect.class.getName()));
setProperty(org.hibernate.cfg.Environment.HBM2DDL_AUTO, environment.getProperty(org.hibernate.cfg.Environment.HBM2DDL_AUTO));
setProperty(org.hibernate.cfg.Environment.ENABLE_LAZY_LOAD_NO_TRANS, environment.getProperty(org.hibernate.cfg.Environment.ENABLE_LAZY_LOAD_NO_TRANS, "true"));
setProperty(org.hibernate.cfg.Environment.CACHE_REGION_FACTORY, environment.getProperty(org.hibernate.cfg.Environment.CACHE_REGION_FACTORY));
setProperty(org.hibernate.cfg.Environment.USE_SECOND_LEVEL_CACHE, environment.getProperty(org.hibernate.cfg.Environment.USE_SECOND_LEVEL_CACHE));
}
};
}
3 changes: 1 addition & 2 deletions assignment/impl/src/test/resources/hibernate.properties
Original file line number Diff line number Diff line change
@@ -2,15 +2,14 @@
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.enable_lazy_load_no_trans=true
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:mem:test
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
hibernate.cache.region.factory_class=org.hibernate.cache.SingletonEhCacheRegionFactory

#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql://localhost:3306/sakai?useUnicode=true&characterEncoding=UTF-8
16 changes: 0 additions & 16 deletions common/impl/src/java/ehcache.xml
Original file line number Diff line number Diff line change
@@ -93,22 +93,6 @@
-->
<!-- Place configuration for your caches following -->

<cache
name="org.hibernate.cache.UpdateTimestampsCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="300"
overflowToDisk="false" />

<cache
name="org.hibernate.cache.StandardQueryCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="300"
overflowToDisk="false" />

<cache
name="org.sakaiproject.component.common.superstructure.NodeParentChildMapImpl"
maxElementsInMemory="10000"
Original file line number Diff line number Diff line change
@@ -1195,8 +1195,6 @@
# The main keys are eternal, timeToLiveSeconds, timeToIdleSeconds, maxElementsInMemory
# See the admin memory tool for a complete list of caches in your environment
# cache list may include but is not limited to:
#org.hibernate.cache.StandardQueryCache
#org.hibernate.cache.UpdateTimestampsCache
#org.sakaiproject.alias.api.AliasService.callCache
#org.sakaiproject.api.privacy.PrivacyManager.PrivacyQueryCache.queryGetPrivacy
#org.sakaiproject.authz.api.SecurityService.cache
9 changes: 4 additions & 5 deletions content-review/impl/compilatio/pom.xml
Original file line number Diff line number Diff line change
@@ -125,15 +125,14 @@
<artifactId>jta</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base Hibernate settings
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:mem:test
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider

#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql://localhost:3306/sakai?useUnicode=true&characterEncoding=UTF-8
5 changes: 0 additions & 5 deletions content-review/impl/dao/pom.xml
Original file line number Diff line number Diff line change
@@ -54,11 +54,6 @@
<artifactId>jta</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base Hibernate settings
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:mem:test
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider

#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql://localhost:3306/sakai?useUnicode=true&characterEncoding=UTF-8
8 changes: 4 additions & 4 deletions content-review/impl/turnitin-oc/pom.xml
Original file line number Diff line number Diff line change
@@ -109,10 +109,6 @@
</dependency>

<!-- needed by hibernate unit tests -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
@@ -140,5 +136,9 @@
<artifactId>spring-jdbc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base Hibernate settings
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:mem:test
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider

#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql://localhost:3306/sakai?useUnicode=true&characterEncoding=UTF-8
9 changes: 4 additions & 5 deletions content-review/impl/turnitin/pom.xml
Original file line number Diff line number Diff line change
@@ -122,11 +122,6 @@
<artifactId>jta</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
@@ -136,5 +131,9 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base Hibernate settings
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:mem:test
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider

#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql://localhost:3306/sakai?useUnicode=true&characterEncoding=UTF-8
4 changes: 0 additions & 4 deletions content-review/impl/urkund/pom.xml
Original file line number Diff line number Diff line change
@@ -142,10 +142,6 @@
</dependency>

<!-- needed by hibernate unit tests -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Base Hibernate settings
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
37 changes: 32 additions & 5 deletions deploy/pom.xml
Original file line number Diff line number Diff line change
@@ -571,6 +571,33 @@
<scope>compile</scope>
</dependency>

<!-- Ignite -->
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-spring</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-slf4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-hibernate-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-hibernate_4.2</artifactId>
<scope>compile</scope>
</dependency>

<!-- xml -->
<dependency>
<groupId>org.dom4j</groupId>
@@ -600,6 +627,11 @@
<scope>compile</scope>
</dependency>
<!-- caching -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
@@ -615,11 +647,6 @@
<artifactId>ehcache-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.terracotta</groupId>
<artifactId>terracotta-toolkit-1.6-runtime</artifactId>
4 changes: 0 additions & 4 deletions emailtemplateservice/impl/logic/pom.xml
Original file line number Diff line number Diff line change
@@ -53,10 +53,6 @@
<artifactId>hibernate-core</artifactId>
</dependency>
<!-- needed by hibernate unit tests -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base Hibernate settings
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create
hibernate.cache.use_second_level_cache=false

# Connection definition to the HSQLDB database
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:mem:test
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider

#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql://localhost:3306/sakai?useUnicode=true&characterEncoding=UTF-8
5 changes: 0 additions & 5 deletions hierarchy/impl/pom.xml
Original file line number Diff line number Diff line change
@@ -35,11 +35,6 @@
<artifactId>javassist</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
2 changes: 1 addition & 1 deletion hierarchy/impl/src/test/hibernate-test.xml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
Loading
Oops, something went wrong.

0 comments on commit f1a6b67

Please sign in to comment.