From 0e64f1957a10734f93ac2446bc88021fe24f038d Mon Sep 17 00:00:00 2001 From: gsd Date: Fri, 29 Sep 2023 00:01:42 +0300 Subject: [PATCH] replica update 2 --- src/main/java/app/services/ShardingService.java | 2 ++ src/main/java/app/services/db/DetectService.java | 2 ++ src/main/java/app/services/db/DonateService.java | 2 ++ src/main/java/app/services/db/UsertimeService.java | 2 +- src/main/java/app/updates/BanCountUpdater.java | 2 ++ src/main/java/app/updates/CountriesUpdater.java | 2 ++ src/main/java/app/updates/UniqueUpdater.java | 2 ++ 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/app/services/ShardingService.java b/src/main/java/app/services/ShardingService.java index ec89dd7..f7ddd86 100644 --- a/src/main/java/app/services/ShardingService.java +++ b/src/main/java/app/services/ShardingService.java @@ -5,10 +5,12 @@ import jakarta.persistence.EntityManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service +@Transactional("RoTransactionManager") public class ShardingService { @Autowired diff --git a/src/main/java/app/services/db/DetectService.java b/src/main/java/app/services/db/DetectService.java index 3e5e7f4..dd5eed5 100644 --- a/src/main/java/app/services/db/DetectService.java +++ b/src/main/java/app/services/db/DetectService.java @@ -9,10 +9,12 @@ import jakarta.persistence.PersistenceContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.*; @Service +@Transactional("RoTransactionManager") public class DetectService { EntityManager entityManager; diff --git a/src/main/java/app/services/db/DonateService.java b/src/main/java/app/services/db/DonateService.java index 10b1251..dcebf03 100644 --- a/src/main/java/app/services/db/DonateService.java +++ b/src/main/java/app/services/db/DonateService.java @@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.HashMap; @@ -20,6 +21,7 @@ import java.util.Map; import java.util.Optional; @Component +@Transactional("RoTransactionManager") public class DonateService { EntityManager entityManager; diff --git a/src/main/java/app/services/db/UsertimeService.java b/src/main/java/app/services/db/UsertimeService.java index 00e44b1..8dfb952 100644 --- a/src/main/java/app/services/db/UsertimeService.java +++ b/src/main/java/app/services/db/UsertimeService.java @@ -16,7 +16,7 @@ import java.sql.Timestamp; import java.util.*; @Service -@Transactional +@Transactional("RoTransactionManager") public class UsertimeService { EntityManager entityManager; diff --git a/src/main/java/app/updates/BanCountUpdater.java b/src/main/java/app/updates/BanCountUpdater.java index a1b9b9c..0ae3a71 100644 --- a/src/main/java/app/updates/BanCountUpdater.java +++ b/src/main/java/app/updates/BanCountUpdater.java @@ -10,10 +10,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import java.time.Instant; @Component +@Transactional("RoTransactionManager") public class BanCountUpdater extends BaseUpdater{ private Stats stats; @Value("${backend.updates.ban_count}") diff --git a/src/main/java/app/updates/CountriesUpdater.java b/src/main/java/app/updates/CountriesUpdater.java index 0741d5c..4cf610f 100644 --- a/src/main/java/app/updates/CountriesUpdater.java +++ b/src/main/java/app/updates/CountriesUpdater.java @@ -13,12 +13,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import java.io.IOException; import java.net.UnknownHostException; import java.util.Map; @Component +@Transactional("RoTransactionManager") public class CountriesUpdater extends BaseUpdater{ Stats stats; GeoIP geoIP; diff --git a/src/main/java/app/updates/UniqueUpdater.java b/src/main/java/app/updates/UniqueUpdater.java index a83d8f8..5d6e947 100644 --- a/src/main/java/app/updates/UniqueUpdater.java +++ b/src/main/java/app/updates/UniqueUpdater.java @@ -11,10 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import static java.time.Instant.now; @Component +@Transactional("RoTransactionManager") public class UniqueUpdater extends BaseUpdater{ Stats stats;