The underlying issue is that previously the SessionBuilder was resolved at the call site when openSession and openTemporarySession were invoked, so the tenant identifier was resolved at that point as well. The change introduced by HHH-13565 Closed changes this and now the tenant is resolved much earlier during SessionFactory construction and won't be re-resolved later. I see there being 3 options here depending on what you guys believe makes the most sense: 1. Restore the behavior previously and resolve SessionBuilder at the call site like we did before 2. Change how we resolve the tenant identifier so it can be re-resolved like previously 3. Change Envers not to use these methods but basically create the temp-session itself like the old code used to I'm not opposed to making change (3) if it makes logical sense as we already do something similar in AuditProcess; however, I asked Giovanni Lovato to report this as I'm more concerned with potential regression behavior that the original change may introduce elsewhere. Andrea Boriero / Sanne Grinovero, do either of you have an opinion here on what you think is the best way to fix this for the next release? |