Quarkus-Hibernate-ORM EntityManager.merge() не обновляет базу данных

У меня есть приложение quarkus с сущностью и классом DAO.

Теперь я пытаюсь обновить Entity, вызвав функцию merge() EntityManager:

      public void update(final T valueObject) {
  getEntityManager().merge(valueObject);
}

Вводится EntityManager:

      @Inject
@PersistenceUnit("MY_DB")
protected EntityManager _entityManager;

а класс DAO - это@Singleton

Когда я звонюupdate()Я не получаю Exception, и в журналах также нет информации, но база данных просто не обновляется. Когда я выполняюpersist()илиremove()на entityManager, который работает, как и ожидалось.

Далее работаю с транзакциями:

      @Inject
private EntityDAO entityDao;

QuarkusTransaction.begin();
entity.setValue("my value");
entityDao.update(entity);
QuarkusTransaction.commit();

Любые идеи, что может быть проблемой по этому вопросу?

Редактировать: Журнал...

      DEBUG [org.hib.eve.int.AbstractFlushingEventListener] (executor-thread-0) Processing flush-time cascades
DEBUG [org.hib.eve.int.AbstractFlushingEventListener] (executor-thread-0) Dirty checking collections
DEBUG [org.hib.eve.int.AbstractFlushingEventListener] (executor-thread-0) Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
DEBUG [org.hib.eve.int.AbstractFlushingEventListener] (executor-thread-0) Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG [org.hib.int.uti.EntityPrinter] (executor-thread-0) Listing entities:
DEBUG [org.hib.int.uti.EntityPrinter] (executor-thread-0) at....{THE UPDATED DATA}
DEBUG [at...LoggingInterceptor] (executor-thread-0) at....update() finished

Итак, я проверил, если сеанс гибернации грязный,

      boolean before = _session.isDirty();
_session.merge(valueObject);
boolean after = _session.isDirty();

но и после слияния сессия не грязная.

0 ответов

Другие вопросы по тегам