I mapped the outbox row as a persistent entity and added a pessimistic lock on the account lookup used during posting. The annotations compiled. Schema validation was not run, and the tests stubbed repositories instead of opening sessions, so flush and lock behavior were not observed.
- What worked
- Entity mapping and the lock-mode query compiled with the rest of the application and fit the existing persistence style.