spring-transactions Questions

2

Solved

I am following this link https://vladmihalcea.com/read-write-read-only-transaction-routing-spring/ to set up the database master and replica instance in my spring boot app. The only difference is I...

3

I have a small Spring Boot application with spring-boot-starter-web, spring-boot-starter-data-jpa, and postgresql as dependencies. I'm able to use the @Transactional annotation and use JPA to fetc...
Cusick asked 23/2, 2018 at 15:30

2

Solved

I have below entity with custom AttributeConverter which saves field in the DB as binary data. TaskEntity.java @Entity @Table(name = "task") public class TaskEntity { @Id @GeneratedValue @Col...
Sycophancy asked 14/11, 2017 at 12:17

4

Solved

I've been trying to test out @TransactionalEvents (a feature of Spring 4.2 https://spring.io/blog/2015/02/11/better-application-events-in-spring-framework-4-2) with our existing Spring JUnit Tests ...
Sherri asked 10/4, 2016 at 22:50

5

Solved

I'm trying to run entityManager.merge(myEntity) within the following method but it seems that the @Transactional annotation is ignored. The Hibernate configuration seems to be fine because I can su...
Mufi asked 22/8, 2015 at 13:24

3

Solved

Update 1 (scroll down) The setup is as follows: Our application database is constructed and used by two separate users: SCHEMA - User that has authority to create and grant permissions on tables ...

7

Solved

Need some help here, I'm not able to understand why my transactions are not getting rolled back in an event of exception. I will try to put my code as close to as It is on the project (cannot share...
Bibliogony asked 11/6, 2021 at 11:47

4

I have a DAO class catching the javax.persistence.PersistenceException wrapping them and rethrowing it as a checked exception. This method is marked as @org.springframework.transaction.annotation.T...
Grube asked 23/11, 2015 at 22:9

3

Solved

I have a service with one method: @Service public class DefaultTestService implements TestService { private static final Logger LOGGER = Logger.getLogger(DefaultTestService.class); @Autowired ...
Metamathematics asked 16/1, 2016 at 22:16

2

I need to do some specific action after the successful transaction commit, which basically includes my analytical operations about the data; I tried using the following code snippet public class ...

5

Solved

We have a micro-services architecture, with Kafka used as the communication mechanism between the services. Some of the services have their own databases. Say the user makes a call to Service A, wh...

3

Solved

I have configured Spring JPA to work with multiple data sources following this example. Spring JPA – Multiple Databases It works as expected but since I want to use different data sources but with ...
Atalante asked 25/3, 2022 at 9:35

1

Solved

I am aware this question has been asked in slightly different formats on this site but following the advices given on those posts took me nowhere. I already spent close to two days on this and I am...
Vince asked 4/8, 2020 at 22:16

2

Why Spring ChainedTransactionManager is deprecated? Does Spring provide any alternative lib to support multiple transaction managers? My use-case:- We are building a Spring Boot application that is...
Alessi asked 23/4, 2021 at 17:32

7

I have found several questions and answers with regard to this issue on SO, but they all seem to cover one major cause of the problem: fetching a collection outside of a transaction or within anoth...
Mainsail asked 23/9, 2013 at 10:19

8

Currently I'm setting autocommit to false in spring through adding a property to a datasource bean id like below : <property name="defaultAutoCommit" value="false" /> But i need to add i...
Calvities asked 8/8, 2014 at 7:7

0

This directly relates to this other question, as a natural follow-up question (which was asked in comments, but was never replied to). Textual description Assuming: the application uses the defaul...

3

Solved

I am using Spring Data and @Transactional annotation(for automatic rollback after tests). I have simple bidirectional relation between account and user(owning side): @Entity @Table(name = "ACCOU...
Rub asked 1/11, 2018 at 23:36

4

Solved

I want to synchronize a kafka transaction with a repository transaction: @Transactional public void syncTransaction(){ myRepository.save(someObject) kafkaTemplate.send(someEvent) } Since the mer...
Hypersthene asked 17/11, 2017 at 15:53

2

Solved

In Spring, if I have: ServiceA.serviceA() -> ServiceB.serviceB() -> ServiceC.serviceC() ->ServiceD.serviceD() where ServiceD.serviceD() can throw a runtime exception: MyRuntimeException...
Margaretmargareta asked 25/8, 2014 at 15:40

6

Solved

I see the following exception message in my IDE when I try to get lazy initialized entity (I can't find where it is stored in the proxy entity so I can't provide the whole stack trace for this exce...

1

Solved

I have a small problem. I have started writing tests for my small project. The project uses SpringBoot, standard JpaRepository from Spring, as a testing framework I am using Spock and for testing t...
Episternum asked 16/12, 2021 at 21:12

3

What is the difference between method with @Transactional(propagation = Propagation.SUPPORTS) vs having no @Transactional annotation at all? @Transactional(propagation = Propagation.SUPPORTS) publ...
Innis asked 23/9, 2019 at 4:43

2

I'm facing an issue I've never experienced before. I'm trying to use a @Lock on a repository Method to avoid concurrency issues and I'm getting the error described on the Title. DB Configuration - ...
P asked 12/7, 2021 at 16:50

2

I am trialing the use of Kotlin's Arrow library Either object to handle exceptions within a project. My experience with it thus far has been OK, but I'm struggling to find a way to handle transacti...

© 2022 - 2025 — McMap. All rights reserved.