diff --git a/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/DataCiteIdentifierServiceImpl.java b/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/DataCiteIdentifierServiceImpl.java index 8b32eaba0f29c4973e1e21bd723de89054af6efd..908eadeefe900044b12e77626196204f9a33f993 100644 --- a/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/DataCiteIdentifierServiceImpl.java +++ b/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/DataCiteIdentifierServiceImpl.java @@ -22,12 +22,12 @@ import org.springframework.core.ParameterizedTypeReference; import org.springframework.core.io.InputStreamResource; import org.springframework.http.*; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.DefaultUriBuilderFactory; -import javax.transaction.Transactional; import java.security.Principal; import java.util.List; @@ -58,22 +58,26 @@ public class DataCiteIdentifierServiceImpl implements IdentifierService { } @Override + @Transactional(readOnly = true) public List<Identifier> findAll(Long databaseId, Long queryId) throws IdentifierNotFoundException { return identifierService.findAll(databaseId, queryId); } @Override + @Transactional(readOnly = true) public Identifier find(Long databaseId, Long queryId) throws IdentifierNotFoundException { return identifierService.find(databaseId, queryId); } @Override + @Transactional(readOnly = true) public List<Identifier> findAll() { return identifierService.findAll(); } @Override - @Transactional(rollbackOn = {Exception.class}) + @Transactional + @javax.transaction.Transactional(rollbackOn = {Exception.class}) public Identifier create(IdentifierCreateDto data, Principal principal, String authorization) throws IdentifierPublishingNotAllowedException, QueryNotFoundException, RemoteUnavailableException, IdentifierAlreadyExistsException, UserNotFoundException, DatabaseNotFoundException, @@ -122,22 +126,26 @@ public class DataCiteIdentifierServiceImpl implements IdentifierService { } @Override + @Transactional(readOnly = true) public Identifier find(Long identifierId) throws IdentifierNotFoundException { return identifierService.find(identifierId); } @Override + @Transactional(readOnly = true) public InputStreamResource exportMetadata(Long id) throws IdentifierNotFoundException { return identifierService.exportMetadata(id); } @Override + @Transactional(readOnly = true) public String exportBibliography(Long id, BibliographyTypeDto style) throws IdentifierNotFoundException, IdentifierRequestException { return identifierService.exportBibliography(id, style); } @Override + @Transactional(readOnly = true) public InputStreamResource exportResource(Long identifierId) throws IdentifierNotFoundException, QueryNotFoundException, RemoteUnavailableException, IdentifierRequestException { @@ -145,7 +153,8 @@ public class DataCiteIdentifierServiceImpl implements IdentifierService { } @Override - @Transactional(rollbackOn = {Exception.class}) + @Transactional + @javax.transaction.Transactional(rollbackOn = {Exception.class}) public Identifier update(Long identifierId, IdentifierDto data) throws IdentifierNotFoundException, IdentifierRequestException { Identifier identifier = identifierService.update(identifierId, data); @@ -197,6 +206,7 @@ public class DataCiteIdentifierServiceImpl implements IdentifierService { } @Override + @Transactional public void delete(Long identifierId) throws IdentifierNotFoundException, NotAllowedException { identifierService.delete(identifierId); } diff --git a/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java b/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java index f5a94274b652b806571b4793402366f269bf2bec..00b639448bdf491fa20991cacb83ad36cb089b6a 100644 --- a/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java +++ b/dbrepo-identifier-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java @@ -20,7 +20,6 @@ import at.tuwien.service.IdentifierService; import at.tuwien.service.UserService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; -import org.springframework.context.annotation.Profile; import org.springframework.core.io.InputStreamResource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/docker-compose.dbrepo2.yml b/docker-compose.dbrepo2.yml index d02ee089f0211b09c11f5d446a60fc4690683489..b459e3a4efbf39241f10a857c624c05e12442870 100644 --- a/docker-compose.dbrepo2.yml +++ b/docker-compose.dbrepo2.yml @@ -8,6 +8,7 @@ volumes: metadata-db-data: search-service-data: broker-service-data: + authentication-service-data: networks: public: @@ -32,7 +33,7 @@ networks: services: dbrepo-metadata-db: - restart: on-failure + restart: "no" container_name: dbrepo-metadata-db hostname: metadata-db image: dbrepo/metadata-db:latest @@ -49,7 +50,7 @@ services: driver: json-file dbrepo-discovery-service: - restart: on-failure + restart: "no" container_name: dbrepo-discovery-service hostname: discovery-service image: dbrepo/discovery-service:latest @@ -61,7 +62,7 @@ services: driver: json-file dbrepo-gateway-service: - restart: on-failure + restart: "no" container_name: dbrepo-gateway-service hostname: gateway-service image: dbrepo/gateway-service:latest @@ -78,7 +79,7 @@ services: driver: json-file dbrepo-database-service: - restart: on-failure + restart: "no" container_name: dbrepo-database-service hostname: database-service image: dbrepo/database-service:latest @@ -100,7 +101,7 @@ services: driver: json-file dbrepo-container-service: - restart: on-failure + restart: "no" container_name: dbrepo-container-service hostname: container-service image: dbrepo/container-service:latest @@ -117,7 +118,7 @@ services: driver: json-file dbrepo-authentication-service: - restart: on-failure + restart: "no" container_name: dbrepo-authentication-service hostname: authentication-service image: dbrepo/authentication-service:latest @@ -125,18 +126,18 @@ services: core: env_file: - .env + volumes: + - authentication-service-data:/opt/keycloak/data/ depends_on: dbrepo-discovery-service: condition: service_healthy - dbrepo-broker-service: - condition: service_started dbrepo-metadata-db: condition: service_healthy logging: driver: json-file dbrepo-query-service: - restart: on-failure + restart: "no" container_name: dbrepo-query-service hostname: query-service image: dbrepo/query-service:latest @@ -148,6 +149,8 @@ services: volumes: - ${SHARED_FILESYSTEM}:/tmp depends_on: + dbrepo-broker-service: + condition: service_started dbrepo-table-service: condition: service_healthy dbrepo-authentication-service: @@ -156,7 +159,7 @@ services: driver: json-file dbrepo-table-service: - restart: on-failure + restart: "no" container_name: dbrepo-table-service hostname: table-service image: dbrepo/table-service:latest @@ -179,7 +182,7 @@ services: driver: json-file dbrepo-identifier-service: - restart: on-failure + restart: "no" container_name: dbrepo-identifier-service hostname: identifier-service image: dbrepo/identifier-service:latest @@ -200,7 +203,7 @@ services: driver: json-file dbrepo-metadata-service: - restart: on-failure + restart: "no" container_name: dbrepo-metadata-service hostname: metadata-service image: dbrepo/metadata-service:latest @@ -209,8 +212,10 @@ services: env_file: - .env depends_on: + dbrepo-authentication-service: + condition: service_healthy dbrepo-metadata-db: - condition: service_started + condition: service_healthy logging: driver: json-file @@ -233,8 +238,27 @@ services: logging: driver: json-file + dbrepo-user-service: + restart: "no" + container_name: dbrepo-user-service + hostname: user-service + image: dbrepo/user-service:latest + networks: + core: + ports: + - "9098:9098" + env_file: + - .env + depends_on: + dbrepo-metadata-db: + condition: service_healthy + dbrepo-authentication-service: + condition: service_healthy + logging: + driver: json-file + dbrepo-semantics-service: - restart: on-failure + restart: "no" container_name: dbrepo-semantics-service hostname: semantics-service image: dbrepo/semantics-service:latest @@ -250,11 +274,13 @@ services: condition: service_healthy dbrepo-metadata-db: condition: service_healthy + dbrepo-authentication-service: + condition: service_healthy logging: driver: json-file dbrepo-broker-service: - restart: on-failure + restart: "no" container_name: dbrepo-broker-service hostname: broker-service image: dbrepo/broker-service:latest @@ -268,6 +294,8 @@ services: depends_on: dbrepo-discovery-service: condition: service_healthy + dbrepo-authentication-service: + condition: service_healthy volumes: - broker-service-data:/var/lib/rabbitmq/ logging: @@ -293,7 +321,7 @@ services: driver: json-file dbrepo-ui: - restart: on-failure + restart: "no" container_name: dbrepo-ui hostname: ui image: dbrepo/ui:latest