Merge branch 'bugfix/order_column_l1_cache' of https://github.com/FOCONIS/ebean into FOCONIS-bugfix/order_column_l1_cache

This commit is contained in:
rob bygrave
2020-04-12 16:37:00 +12:00
2 changed files with 35 additions and 0 deletions
@@ -179,6 +179,11 @@ public class SaveManyBeans extends SaveManyBase {
if (!skipSavingThisBean) {
persister.saveRecurse(detail, transaction, parentBean, request.getFlags());
if (many.hasOrderColumn()) {
// Clear the bean from the PersistenceContext (L1 cache), because the order of referenced beans might have changed
final BeanDescriptor<?> beanDescriptor = many.getBeanDescriptor();
beanDescriptor.contextClear(transaction.getPersistenceContext(), beanDescriptor.getId(parentBean));
}
}
}
}