mirror of https://github.com/apache/openjpa.git
OPENJPA-1155 Committing code contributed by Dianne Richards. This update ensures that all entities, especially those loaded during detachment get cascaded during detach.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@791568 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10bd4e70de
commit
9ee5383721
|
@ -3321,8 +3321,17 @@ public class BrokerImpl
|
|||
|
||||
if (call == null)
|
||||
call = _call;
|
||||
new DetachManager(this, true, call).detachAll
|
||||
(new ManagedObjectCollection(states));
|
||||
// Make sure ALL entities are detached, even new ones that are loaded
|
||||
// during the detach processing
|
||||
boolean origCascade = _compat.getCascadeWithDetach();
|
||||
_compat.setCascadeWithDetach(true);
|
||||
try {
|
||||
new DetachManager(this, true, call)
|
||||
.detachAll(new ManagedObjectCollection(states));
|
||||
}
|
||||
finally {
|
||||
_compat.setCascadeWithDetach(origCascade);
|
||||
}
|
||||
}
|
||||
|
||||
public Object attach(Object obj, boolean copyNew, OpCallbacks call) {
|
||||
|
|
Loading…
Reference in New Issue