JPA Hibernate updates an entity but there are no any changes in the DB

JPA Hibernate updates an entity but there are no any changes in the DB

In short, I have three methods:

In short, I have three methods:

    @Transactional(propagation=Propagation.REQUIRED, noRollbackFor=Exception.class)
    public void Manage(long bookId) throws Exception {

    Book book = dao.getByKey(bookId);




@Transactional(propagation=Propagation.REQUIRED, noRollbackFor=Exception.class)
public void register(Book book) {

    try {

        // updateSomeId method should be called in another thread
        Runnable task = () -> {

            if(someId > 0) {
                dao.updateSomeId(book, someId);

        Thread thread = new Thread(task);
    } catch (Exception e) {



@Transactional(propagation=Propagation.REQUIRED, noRollbackFor=Exception.class)
public void updateSomeId(Book book, long someId) {
    try {
        Book findedBook = getByKey(book.getBookId());
    } catch (Exception e) {
        logger.error("error", e);

updateSomeId method must update the someId property in Book table.

In the log I see: Hibernate: update Book set author=?, someId=? where bookId=?

But, there are no any changes in my DB, no any errors. Could anyone explain what happens and how to solve it? It's one of thousands of updates I have and only in this case it hasn't updated the DB table.

JPA 2.1

Hibernate 5.2.10.Final

java spring jpa hibernate

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Multitenant configuration: StaleObjectStateException on Transaction (hibernate + spring-data-jpa)

i'm trying to setup a configuration for manage a multi-tenant enviroment with spring-boot, spring-data-jpa, hibernate and mysql (same schema, every tenant table has a tenant_code column). For dependencies the parent maven project is&nbsp;<strong>spring-boot-starter-parent</strong>&nbsp;(2.1.2.RELEASE).

Understand to Spring Boot: MySQL and JPA, Hibernate

Spring Boot uses Hibernate as the default JPA implementation. The property spring.jpa.hibernate.ddl-auto is used for database initialization. I've used the value “update” for this property.

Spring Boot + JPA + Hibernate + Oracle

In this tutorial, we will learn how to create a Spring Boot application that communicates with an Oracle data source through Hibernate.

Learn Hibernate and Spring for Beginners (Includes Spring Boot)

Spring 5: Learn Spring 5 Core, AOP, Spring MVC, Spring Security, Spring REST, Spring Boot 2, Thymeleaf, JPA & Hibernate