mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
For experimental "transparent persistence" - Delete removes from PC early
When delete bean executed with transparent persistence, this marks the bean as removed from the persistence context early. This avoids a "dirty" deleted bean from being seen as a "dirty" bean in the persistence context at flush() time.
This commit is contained in:
1 parent
a617d58902
commit
ba397bbb0c
3 files changed
+32
No files matched your search
@@ -887,6 +887,14 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove deleted beans from the persistence context early.
|
||||
*/
|
||||
public void removeFromPersistenceContext() {
|
||||
idValue = beanDescriptor.getId(entityBean);
|
||||
beanDescriptor.contextDeleted(transaction.getPersistenceContext(), idValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggressive L1 and L2 cache cleanup for deletes.
|
||||
*/
|
||||
|
||||
@@ -881,6 +881,7 @@ public final class DefaultPersister implements Persister {
|
||||
}
|
||||
|
||||
int count = request.executeOrQueue();
|
||||
request.removeFromPersistenceContext();
|
||||
|
||||
if (request.isPersistCascade()) {
|
||||
deleteAssocOne(request);
|
||||
|
||||
Reference in new issue
Block a user