PostInsertEventListenerImpl引发ConcurrentModificationException之后

时间:2018-08-17 09:29:04

标签: java hibernate java-ee wildfly

我有一个实现PostInsertEventListener的InsertEventListenerImpl类,在该类中,我创建了新的实体UserHistory并将其持久化

     Caused by: java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
    at java.util.ArrayList$Itr.next(ArrayList.java:859)
    at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:580)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:456)
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1282)
    at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1300)
    at org.jboss.as.jpa.container.AbstractEntityManager.flush(AbstractEntityManager.java:459)
    at com.ekassa.profile.dao.UserDaoImpl.saveUser(UserDaoImpl.java:62)
    at com.ekassa.profile.services.ProfileService.createUser(ProfileService.java:571)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

}

但是当方法onPostInsert完成执行时,会得到错误

1 job per POD

首先,我不知道自己更新了哪个列表,以及如何处理此错误

0 个答案:

没有答案