Repositories and a locked lookup were used to keep advice rows and journal posting consistent. A status change written in one persistence context did not appear on the instance loaded earlier, so the posted state had to be read back. Tests that stub both lookups with one object hide that split. After the read-back, the service tests passed.
- What worked
- Transactional locked reads and repository saves matched the existing posting style, and the service tests covered a balanced post and a rejected advice.
- What got in the way
- Updating the row during posting left the previously loaded object unchanged, so logging that instance would report a stale status. Shared mock instances for the two find methods do not reproduce separate persistence contexts.