439 questions
0
votes
0
answers
25
views
Hibernate 6 Migration: OptimisticLockException and TransientObjectException When Copying Entities Between Two SQLite Databases
Use Case
Users can copy a subset of entities and their object graphs from a main SQLite database to an archive SQLite database, preserving IDs and relationships (1-to-1 copy). After migrating from ...
0
votes
0
answers
62
views
Redis Lettuce Optimistic Locking in Java Reactive
I'm trying to implement Optimistic Locking with Redis Lettuce client in Java Reactive according to this article: https://github.com/redis/lettuce/wiki/Reactive-API#other-examples.
I got 2 approaches, ...
0
votes
0
answers
26
views
Jakarta @Version sql update version error
All entity with @version
During saving, have next error
could not execute statement [Not found 3 param.] [update cons_data.e_fin_form set version=? where id=? and report_type=? and version=?]; SQL [...
5
votes
1
answer
1k
views
Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):
I'm working on a Spring Boot application where I create an order using a createOrder method. Everytime, I encounter the following error:
OrderService
public class OrderService {
OrderRepository ...
-1
votes
1
answer
238
views
org.hibernate.StaleObjectStateException : Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
Gone through all the code bit by bit but just can't find what is wrong, if I make postman getUsers request it works fine, but when I make the POST request I get the error:
ERROR 7388 --- [...
1
vote
0
answers
40
views
concurrency in spring jpa with postgres
I am using jpa in my spring boot application (postgres) and have some entity called car. In the beginning cars are created without assignedUser field in database.
Then trough certain process (post ...
1
vote
0
answers
82
views
Why does this optimistic lock fails?
I was experimenting with optimistic locks and wrote this for hset, under heavy load of events trying to update the same key, observed TxFailedErr(redis: transaction failed) from redis client which is ...
2
votes
4
answers
413
views
Hibernate With Only Optimistic Locking Still Generates Deadlocks
We have a business application which uses Spring Boot, Hibernate, and an underlying Oracle Database (H2 database for tests).
Users make a lot of simultaneous requests to it.
To cope with the many ...
0
votes
0
answers
60
views
Spring Boot Batch with TaskExecutor OptimisticLockingFailureException
I use Spring Boot 3 (Batch 5) with Spring Data and Oracle Database.
I have one Job with an Item Reader and a Writer (without a processor)
Everything is working fine, Now to make job process fast, want ...
-2
votes
1
answer
78
views
In SQL, is it possible/safe to implement optimistic locking using a boolean instead of version increments?
I am trying to implement a simple mutex lock in SQL. My tentative solution is the following:
query = 'UPDATE my_table SET lock_field = 1 WHERE lock_field = 0 AND mutex_id = 17'
if (query.execute() == ...
1
vote
0
answers
46
views
How to setup optimistic locking for overlapping datetime?
I am trying to make a booking system, where users can book a booking at a location for a certain time period. The problem I am having is, 2 entries that happen at the same time and overlap in the time ...
0
votes
0
answers
57
views
Optimistic lock problem ( return entity no problem, return void optimistic lock)
The first method is working fine, but the others are returning errors. Why am I getting these errors? Both methods have the same purpose; however, one of them returns an entity, while the others do ...
0
votes
1
answer
17
views
JPA repository OptimisticLockingException not thrown
I wrote a JPA repository and a entity with version field to support optimistic locking.
@Version
var version: Long? = null
I wrote a test, which simulates concurrent update and delete and ...
0
votes
1
answer
49
views
Handling a specific scenario with a Test to verify that it's correctly implemented the Optimistic Lock
I'm tryng to get more into Optimistic Lock and in detail, verifyng with a test, that my implementation it's correct. The implementation it's with Java 11, SpringBoot and Maven interacting with a ...
1
vote
0
answers
146
views
Delphi - How to achieve optimistic locking in a multi-client environment?
Preface
Users use a thick client application which connects to a Postgres database.
So, multi-user, multi-db connection environment.
Application is a simple ERP design with material stock, material ...