If a service is multithreaded, should each thread be registered as a separate EPR, or
should there only be 1 EPR for the entire set of threads for this service?
The current issue we have is the following:
In the current implementation we only have one EPR for each service, which currently
eventhough we only allow 1 thread, is sometimes causing us issues when the configuration
is reloaded. It turns out that in this case the new thread B is created before thread A
has ended, and the same EPR gets registered twice. Upon unregistering thread A both these
EPRs are removed from the registry and upon unregistering thread B the registry throws an
exception since no matching EPR exists any longer.
The issue can be resolved by registering each thread as it's own EPR. This is easily
done simply by adding a UID to the EPR, since upon unregistering we simply do a string
comparison on the xml-serialized EPR. However personally I am worried that we will end up
with a lot of 'dead' EPRs. If an unclean shutdown happens, the EPRs will never be
removed from the registry. Therefore personally I think that the parent of all the threads
should be responsible for registering the service with it's EPR and it should not get
unregistered until the last thread ends. Can this be done in the current implentation?
Any other ideas are welcome!
Cheers,
--Kurt
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990768#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...