Session lifecycle
Handle refresh, optimistic conflicts, tenant isolation and deletion within the supported runtime.
Reload deliberately
refresh reloads the locale-resolved fields and their row version. A refresh with unflushed translation-row changes is rejected; clear and evict discard the corresponding snapshots.
Refresh clean state
Load and refresh in a transaction. Perform this before creating unsaved editor changes in the same Session.
Concurrent writes to the same locale row reject the stale commit, including editor versus domain writes. Different locale rows can be edited independently.
Fix tenant and locale together
A shared-table parent with a String @TenantId uses the tenant-aware Session overload. Loading, HQL and editor access stay within that Session tenant.
A tenant-bound Session
The generated translation row carries the tenant and a cascading reference to the parent's ID and tenant key.
Database cascades delete translation rows, but HQL bulk deletion leaves already managed objects stale. Clear the Session after a bulk operation before loading affected entities again.