Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366427

Summary: EntityManagerFactory.getPersistenceUnitUtil() does not throw IllegalStateException when the entity manager factory has been closed
Product: z_Archived Reporter: Stephen DiMilla <stephen.dimilla>
Component: EclipselinkAssignee: Tom Ware <tom.ware>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: lance.andersen, stephen.dimilla, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
proposed fix
none
additional patch none

Description Stephen DiMilla CLA 2011-12-12 10:56:41 EST
Build Identifier: eclipselink-2.3.0.v20110604-r9504

Client code:

           EntityManagerFactory emf = em.getEntityManagerFactory();
            emf.close();
            try {
                System.out.println("call getPersistenceUnitUtil() after close");
                emf.getPersistenceUnitUtil();
                System.out.println("IllegalStateException not thrown");
            } catch (IllegalStateException ise) {
                System.out.println("Received expected IllegalStateException");
            }
--------------
output:

call getPersistenceUnitUtil() after close
IllegalStateException not thrown


Reproducible: Always
Comment 1 Tom Ware CLA 2012-04-05 11:01:23 EDT
Updating target milestone.
Comment 2 Tom Ware CLA 2013-02-05 10:19:50 EST
Created attachment 226572 [details]
proposed fix
Comment 3 Tom Ware CLA 2013-02-05 11:50:10 EST
Bugs 366407, 366427, 366464, 382537 fixed in same transaction

Reviewed by Guy Pelletier

Tests added to JPA 2.1 test suites, QueryTestSuite, EntityManagerTestSuite and EntityManagerFactoryTestSuite

Tested with JPA LRG
Comment 4 Tom Ware CLA 2013-02-20 10:06:43 EST
Created attachment 227338 [details]
additional patch
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:06:08 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink