0

I've just updated from wildfly 12 to 18, and from Java 8 to 11. No code has been changed within my project. Running the integration tests has produced a really odd problem though. UPDATE statements no longer seem to be running. For example:

@Transactional
public void updateStatus(final long id, final Status status)
{
    final Item item = entityManager.find(Item.class, id, LockModeType.PESSIMISTIC_WRITE);
    item.setStatus(status);
    entityManager.merge(item);
}

Previously this would cause an update statement to be run, now nothing happens. If I call entityManager.flush() after the merge() an update statement is run, but the database does not reflect the updated entity.

No idea what might cause this sort of thing. Only thing I can think of is that some default config in wildfly 18 is different to 12?

Stefan Zobel
  • 3,182
  • 7
  • 28
  • 38
Martin Cassidy
  • 686
  • 1
  • 9
  • 28

1 Answers1

1

This issue seems very similar (or the same) to this one: How to fix hibernate.transaction.flush_before_completion issue with JTA transactions in JBOSS EAP 7.2?

Removing

<property name="hibernate.transaction.flush_before_completion" value="true" />

From my persistence.xml did the trick.

Martin Cassidy
  • 686
  • 1
  • 9
  • 28