Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Second level cache lifespan?

What is the lifespan of the second level cache in a JPA-compliant environment?  If I undeploy a persistence unit, that will kill off the second level cache established for that persistence unit, correct?

I am doing some integration testing with embedded GlassFish and experimenting with parallel JUnit integration tests using Maven SureFire.

I have an instance of embedded GlassFish up, and I deploy and undeploy various Java EE modules to it.  I am looking to do this in parallel, so that for each JUnit test I would deploy the app with a new underlying H2-in-memory connection pool/database (for maximum isolation).  I want to ensure that caching is on during the test, but does not affect subsequent tests.

I'm assuming that the EclipseLink second level cache lives and dies with the persistence unit, and doesn't lurk on in the background, zombielike, if that persistence unit is unloaded?

I've read http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Caching/Caching_Overview, and noted with some interest the eclipselink.session.name property.  Does that in effect control how many caches there are?

Best,
Laird

--
http://about.me/lairdnelson


Back to the top