openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Beer <>
Subject ConcurrentModificationException - On removal of Object from list
Date Thu, 28 Nov 2013 13:09:36 GMT
Hi All

I am getting a ConcurrentModificationException when removing an item from a
@OneToMany List. I am using openjpa 2.2.2 and have the following code for
the Entity:

@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private List<AdditionalInformation> addInfo;

So the Item passed in has all the information, the code to remove an item
is this.addInfo.remove(ai); where ai is the object to be removed, this is
removed from the list ok, but once the process has finished that it throws
a ConcurrentModification Exxception. The item is not removed from the
database and the process is stopped.

How ever this only occurs if there is more than one item in the list, if I
remove a single item from the list the item is removed from the list along
with the reference to hat relationship in the RELATIONSHIP table but not
from the table for the Entity that is supposed to be removed.

Do I need to remove the item from the database first and then from the list?

Any thoughts much appreciated.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message