JBSEAM-2419 (IAE when concurrently called a factory) had been solved by
introducing a lock on the getInstanceFromFactory method. It turned out
to cause deadlocks under some circumstances (JBSEAM-4669). So I've moved
the lock deeper into the method . Could someone review this change
and approve it?
It would be also nice if there was a lock per every factory. It might
have some performance benefits. Or disadvantages. Profiling should give