![](/img/trans.png)
[英]Wildfly 18 throws ModuleNotFoundException after module was added
[英]EntityManager has stopped running update statements after upgrading to wildfly 18
我剛剛從 wildfly 12 更新到 18,從 Java 8 更新到 11。我的項目中沒有更改任何代碼。 不過,運行集成測試產生了一個非常奇怪的問題。 UPDATE 語句似乎不再運行。 例如:
@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);
}
以前這會導致運行更新語句,現在什么也沒有發生。 如果我在merge()
entityManager.flush()
,則會運行更新語句,但數據庫不會反映更新后的實體。
不知道什么可能導致這種事情。 我唯一能想到的是wildfly 18中的一些默認配置與12不同?
這個問題似乎與這個問題非常相似(或相同): How to fix hibernate.transaction.flush_before_completion issue with JTA transactions in JBOSS EAP 7.2?
移除
<property name="hibernate.transaction.flush_before_completion" value="true" />
根據我的persistence.xml
成功了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.