2,010 questions
0
votes
0
answers
81
views
Why does JPA defer UPDATE statements until transaction commit regardless of database isolation level?
In JPA, when an entity is modified inside a transaction (e.g., via a setter), the change is tracked only in the persistence context through dirty checking, and the actual UPDATE SQL is sent to the ...
3
votes
1
answer
544
views
Spring Boot 4 + Kafka in transaction mode
I created a simple application which just sends in a loop messages to Kafka using KafkaTemplate with transaction mode. But, unfortunately, my code doesn't work with @Transactional in the new Spring. I ...
1
vote
1
answer
65
views
MultiResourceItemWriter does not work with transactional StaxEventItemWriter
I configured a StaxEventItemWriter like this:
@Bean
public StaxEventItemWriter<Foo> fooWriter() {
return new StaxEventItemWriterBuilder<Foo>()
.name("fooWriter")
...
0
votes
1
answer
78
views
Delete then create entity using Spring JPA with Hibernate and @Transactional violates unique key constraints
Setup: SpringBoot application using SpringJPA with Hibernate
I have two entities: A and B. Set is a child of A.
I want to remove a B and create another one in a characteristic which would hit a unique ...
0
votes
0
answers
64
views
NonUniqueObjectException when save nested entity
I'm trying to test how transaction works, it's a very simple example.
Entity class:
public class BettingProgram {
@Id
private int id;
@Column(name = "name", nullable = false)
private String ...
0
votes
0
answers
35
views
Springboot + Mybatis: Insert rows into multiple tables asynchronously
I have a customer json like below
{
"id": "id",
"name": "full name",
"products": [{
"id": "pid1",
&...
2
votes
2
answers
144
views
Spring @Transactional – Commit not visible after method return?
I’m working on a modular Java application using Spring 5.1.20.RELEASE, where a core module is used by several client-specific instances. Each instance has its own configuration and business rules.
In ...
1
vote
0
answers
203
views
How to use Kotlin Coroutines with spring @Transactional
How to run Kotlin Coroutines and persist data to database in a transaction?
I am trying to create a batch-application which will start x number of processes that do some work.
These processes can run ...
2
votes
0
answers
134
views
Spring 3.4.1 integration test-> Unable to evaluate the children renderer expression Method threw 'java.lang.AssertionError'
recently I have updated spring boot from 3.3.8 to newer version which is 3.4.1 and suddenly I have started to face a lot of new problems with integration tests. Few of them were really easy to adjust, ...
0
votes
1
answer
66
views
Transaction management in both apache kafka and RDBMS
Is it good practice to achive atomicity by following code.
I know 2 phase commit concept, outbox pattern. I don't want to use third party library like Atomiko.
@Transactional
Public void test ...
0
votes
0
answers
89
views
Error creation of transaction manager beans when using spring batch
Post upgrading to spring boot 3.4.3 and batch v5.2.1, getting below error when starting spring boot project:
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean ...
2
votes
1
answer
2k
views
@TransactionalEventListener with @Transactional and propagations REQUIRES_NEW, NOT_SUPPORTED
I don't understand why this is needed now. I can't start my application because I have a service with @Transactional annotation and some methods with @TransactionalEventListener, and everything was ...
2
votes
1
answer
307
views
SQL Server transaction management via Springboot 3 and Hibernate 6
I'm moving an old Java SpringBoot-base application from version 2.x.x to latest v3.4.2.
This update forced me to fix several dependencies, in particular:
Update Hibernate from v5.x.x to v6.6.8-Final
...
0
votes
1
answer
88
views
Replacing Spring Boot TransactionInterceptor
I am trying to upgrade a legacy spring-hibernate (no jpa) project to spring-jpa.
The project has some monkeying around datasource, transactionManager generation etc.., basically we are generating all ...
0
votes
1
answer
152
views
@Retryable with a transactional context
I have an issue when two threads try to create an entity in my database.
The first thread checks if the object exists, sees that it is not there, and then creates it. However, at the same time, the ...