Hi Gordon,
Please find attached a fix for issue 1003
<
https://glassfish.dev.java.net/issues/show_bug.cgi?id=1033>.
Following is a summary:
Changed the EntityManagerFactoryImpl.#entityManagers to be a linked list
Added a new method emClosed() to EntityManagerFactoryImpl. This method
is called from EntityManagerImpl.close(). The method iterates over the
list and cleans up as required.
Tests run:
A local test exercising the code.
Scott Oaks is running Specj with this code.
This bug is one of the show stoppers for the UR1 release which has a HCF
tomorrow (Wed). :(
Please note that the fix has a limitation of not cleaning up the list in
EntityManagerFactoryImpl if none of the ems of an application call
close(). The implementation to solve it is a bit more involved. At this
point I am wondering whether we need to maintain the list of
entitymanagers at all in. I can implement the involved fix if
maintaining the list is really required.
Thanks,
Mitesh