Hi Eric,
Basically, spring by default nature is handing over singleton objects. Now what you are seeing is the instance of entity manager will be
provided via entity manager factory which you have already configured in the context. As these resources are pretty expensive, the responsibility
is of entity manager factory to give the manager when desired. Resource intensive things like entity manager factory implement singleton
pattern
themselves, so always a singleton object will be handed over.
Thread safety is a different thing, i guess some of the responsibility, programmer has
to cater themsevles also. I will strongly welcome some other opinions as well. Eric, there should be one entity manager for a whole complete web application,
so yes
you should not worry about shared entity manager at all.
BR,