| If I have multiple threads, all trying to use StatementPreparer, then what happens is that they all get a RefCursorSupport from the service registry, and start using it. The problem is, the initialisation process is: 1) create the instance of RefCursorSupport, 2) add it to the service registry, 3) then initialise the fields on it (specifically, jdbcServices). However, because the object is available from the service registry after creation, but before initialisation, the other threads can pull this back and start using it without jdbcServices initialised. This is a pervasive problem for all the objects in the service registry which have injected services that they depend on, I would think. I'm very surprised this hasn't been spotted sooner and fixed. cheers, Rob p.s. Originally I opened this on the wrong JIRA, here: https://issues.jboss.org/browse/HIBERNATE-152 |