I suggest to create a bug report in our Issue Tracker and attach HAL code that is causing compile errors. Just looking at your code I don't see anything wrong with it so it likely should be investigated.
Hi, Paul.
Sounds like you're talking about REST API. And that your are overwriting data with older values if B managed to read record before A finished to update it. Classic conflict resolution ...