Hi, I can confirm this one; Apparently updates to the members of embedded collection elements are not propagated in conjunction with {{@OrderColumn}} (it works as expected without an order column) . I need to dig a bit deeper to understand the cause.
To work around the issue until we have a fix, you might remove and re-add the element to be updated (in two separate flush cycles, though). Or you use an association instead of an embedded collection, updates are definitely working there as expected.
Btw. in your test (which is very clear, thanks for providing it) I saw you do the updates to order and product in separate transactions. Not sure whether this is for testing purposes only, but it's not required. You can do several operations (inserts, updates etc.) in one "transaction" and commit it at the end. All the changes will be collected and be executed in one go upon flush. This allows for some optimizations and narrows the time window for all the writes. Just be aware that no roll-back is possible (as MongoDB doesn't support multi-document transactions), so the transaction just forms the context for collecting and flushing changes.
|