]
Steve Ebersole closed HIBERNATE-152.
------------------------------------
Resolution: Rejected
ServiceRegistry race condition
------------------------------
Key: HIBERNATE-152
URL:
https://issues.jboss.org/browse/HIBERNATE-152
Project: Hibernate Integration
Issue Type: Bug
Reporter: rob moffat
Assignee: Steve Ebersole
Priority: Minor
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