Lukasz - I have queried you on this before, but I am trying to get to the bottom of why the class Dale Newfield recommended (many years ago) to solve the Open Session during ExecuteAndWait problem gives me issues from time to time [1]. Recently (as our user base grows) I am getting NPEs more and more on the synchronized "lock" variable. I posed the question to StackExchange [2], and one contributor suggested there is a race condition by extending the BackgroundProcess class.
Full disclosure, this kind of problem starts to get over my head, so I am wondering if you might have some guidance on how I can once and for all fix this issue. As always, thanks in advance. [1] https://cwiki.apache.org/confluence/display/WW/HibernateAndSpringEnabledExecuteAndWaitInterceptor [2] https://stackoverflow.com/questions/73858251/how-to-properly-use-a-lock-variable-for-synchronization-in-a-serializable-clas?noredirect=1#comment130421653_73858251