Skip to content

Commit

Permalink
Fix ConcurrentModificationException in BatchFetchPolicy - backport fr…
Browse files Browse the repository at this point in the history
…om 2.7 (#1708)

Fixes #1506 . This change will fix the ConcurrentModificationException of the attributeExpression list, when running the same (batch)query with different entity managers.

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman committed Jan 9, 2023
1 parent 61661a0 commit e7971e4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -77,6 +77,9 @@ public BatchFetchPolicy clone() {
dataResults.put(clone, list);
}
clone.setDataResults(dataResults);
if(this.attributeExpressions != null) {
clone.attributeExpressions = new ArrayList<>(this.attributeExpressions);
}
return clone;
}

Expand Down

0 comments on commit e7971e4

Please sign in to comment.