I believe {{cleanup}} is also invoked more than once on the same {{Service}} instance (the one that is actually stored in {{WeldManager}}'s {{ServiceRegistry}}, not the two that are thrown away). I'll investigate this
{time passes}
Yes, my {{JpaInjectionServices}} instance that is actually stored in a {{ServiceRegistry}} by {{AdditionalServiceLoader}} has its {{cleanup}} method invoked once per {{BeanManager}}. So the instance itself is shared among the {{BeanManager}}s, and get back I assume that its {{resolvePersistenceContextInjectionPoint(InjectionPoint)}} method, for example, is called at various points by the different {{BeanManager}}s it belongs to you . Then its {{cleanup}} method is invoked by all of them.
This is not strictly speaking a problem, just something that perhaps should be documented as it's a very unique lifecycle, particularly when coupled with the fact that some {{Service}} instances are thrown away. |
|