Skip to content

Commit

Permalink
Remove query cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ofux committed Nov 22, 2024
1 parent 028ea01 commit a9e1d0e
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 203 deletions.
9 changes: 0 additions & 9 deletions bootstrap/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ spring:
database-platform: org.hibernate.dialect.PostgreSQLDialect
properties:
hibernate:
cache:
region.factory_class: org.hibernate.cache.jcache.internal.JCacheRegionFactory
use_second_level_cache: false
use_query_cache: true
javax:
cache:
provider: org.ehcache.jsr107.EhcacheCachingProvider
uri: classpath:ehcache.xml
missing_cache_strategy: fail
query:
in_clause_parameter_padding: true
event:
Expand Down
73 changes: 0 additions & 73 deletions bootstrap/src/main/resources/ehcache.xml

This file was deleted.

6 changes: 0 additions & 6 deletions bootstrap/src/test/resources/application-it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ spring:
maxLifetime: 60000
maximumPoolSize: 10
minimumIdle: 1
jpa:
properties:
hibernate:
cache:
use_second_level_cache: false
use_query_cache: false
decorator:
datasource:
datasource-proxy:
Expand Down
11 changes: 0 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,6 @@
<artifactId>dd-trace-api</artifactId>
<version>1.40.0</version>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.8</version>
<classifier>jakarta</classifier>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>6.4.4.Final</version>
</dependency>


<!-- AWS Dependencies -->
Expand Down
13 changes: 0 additions & 13 deletions read-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,5 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<classifier>jakarta</classifier>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jcache</artifactId>
</dependency>
</dependencies>
</project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package onlydust.com.marketplace.api.read.repositories;

import onlydust.com.marketplace.api.read.cache.QueryCacheS;
import onlydust.com.marketplace.api.read.entities.BannerReadEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -26,15 +25,13 @@ public interface BannerReadRepository extends Repository<BannerReadEntity, UUID>
AND c.userId = :userId
))
""")
@QueryCacheS
Optional<BannerReadEntity> findMyFirstVisibleBanner(UUID userId);

@Query("""
SELECT b
FROM BannerReadEntity b
WHERE b.visible = true
""")
@QueryCacheS
Optional<BannerReadEntity> findFirstVisibleBanner();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import onlydust.com.marketplace.api.contract.model.ContributionsSortEnum;
import onlydust.com.marketplace.api.contract.model.DataSourceEnum;
import onlydust.com.marketplace.api.contract.model.SortDirection;
import onlydust.com.marketplace.api.read.cache.QueryCacheS;
import onlydust.com.marketplace.api.read.entities.bi.ContributionReadEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
Expand Down Expand Up @@ -75,7 +74,6 @@ left join contributor_project_contributor_labels cpcl on coalesce(:projectContri
ccd.contribution_uuid,
rd.contribution_uuid
""", nativeQuery = true)
@QueryCacheS
Page<ContributionReadEntity> findAll(ZonedDateTime fromDate,
ZonedDateTime toDate,
@NonNull Boolean onlyOnlyDustData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package onlydust.com.marketplace.api.read.repositories;

import onlydust.com.marketplace.api.read.cache.QueryCacheM;
import onlydust.com.marketplace.api.read.entities.project.ProjectContributorsQueryEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -107,7 +106,6 @@ select count(ga.id)
and (:login is null or ga.login ilike '%' || :login || '%')
and (hc.contributor_github_user_id is null or :showHidden)
""", nativeQuery = true)
@QueryCacheM
Page<ProjectContributorsQueryEntity> findProjectContributors(final UUID projectId,
final String login,
final UUID projectLeadId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package onlydust.com.marketplace.api.read.repositories;

import onlydust.com.marketplace.api.read.cache.QueryCacheXS;
import onlydust.com.marketplace.api.read.entities.project.ProjectReadEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -12,10 +11,8 @@

public interface ProjectReadRepository extends Repository<ProjectReadEntity, UUID> {

@QueryCacheXS
Optional<ProjectReadEntity> findById(UUID id);

@QueryCacheXS
Optional<ProjectReadEntity> findBySlug(String slug);

@Query("""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package onlydust.com.marketplace.api.read.repositories;

import onlydust.com.marketplace.api.read.cache.QueryCacheM;
import onlydust.com.marketplace.api.read.entities.project.ProjectPageItemQueryEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -63,7 +62,6 @@ LEFT JOIN LATERAL (
cast(:hasGoodFirstIssues as boolean) is false and pcd.good_first_issue_count = 0)
and (cast(:search as text) is null or p.search ilike '%' || cast(:search as text) || '%')
""", nativeQuery = true)
@QueryCacheM
Page<ProjectPageItemQueryEntity> findAll(UUID userId,
Boolean mine,
String search,
Expand Down

0 comments on commit a9e1d0e

Please sign in to comment.