So what is this buying us?
The current Hibernate ORM thread id checking, does not properly handle
the case when the application thread changes between calls to the
Hibernate session. The new approach does handle the application thread
changing between session invocations and also covers a few other cases
as well (like clearing the persistence context after the application may
of added another entity after the background thread rolled back the
transaction).