Prevent duplicate insert of useratom
@@ -215,8 +215,12 @@ public class User implements UserDetails, Persistable<Long> {
* public List<Atom> getAtoms() { return atoms; }
*/
public void addAtomUri(UserAtom userAtom) {
+ synchronized (this) {
+ if (!this.userAtoms.contains(userAtom)) {
this.userAtoms.add(userAtom);
}
+ }
+ }
public void deleteAtomUri(UserAtom userAtom) {
for (int i = 0; i < this.userAtoms.size(); i++) {
