Hi it shouldnt leak if you use 2 different EntityManagerFactories.
Can you share a project with tomee-maven-plugin sets up to reproduce it on a public repository? Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> 2015-06-11 6:46 GMT+02:00 dave <[email protected]>: > Hi, > > we are encountering an OpenJPA problem when running two different versions > of the same web application under one instance of TomEE (version 1.7.2). > The > problem only occurs when persistent fields have been added to a JPA entity > class in one version of the application but not in the other. When > attempting to access the entity in the application instance that has the > additional fields we receive an error saying one of the fields cannot be > found. > > The underlying exception is: > > Caused by: java.lang.IllegalArgumentException: Attribute > "referrerCellPhone" > of any not found in xxx.domain.Case > at > > org.apache.openjpa.persistence.meta.AbstractManagedType.notFoundException(AbstractManagedType.java:741) > at > > org.apache.openjpa.persistence.meta.AbstractManagedType.getAttribute(AbstractManagedType.java:244) > at > > org.apache.openjpa.persistence.meta.AbstractManagedType.getAttribute(AbstractManagedType.java:468) > at > > org.apache.openjpa.persistence.meta.MetamodelImpl.populate(MetamodelImpl.java:339) > ... 84 more > > The applications run fine individually and also when deploying the version > that has a superset of the fields prior to deploying the one with a subset > of fields. Deploying them in the reverse order causes the above exception > however. > > We have traced this in a debugger and it seems to be related to the field > meta data classes being cached from the first deployed instance of the > application and these cached classes being used when attempting to get the > attribute in the other application instance. The entity classes themselves > seem to be correct, but not the meta data. > > Are there any known issues with application isolation with OpenJPA under > TomEE? > > Thanks, > Dave > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/OpenJPA-exception-when-running-different-versions-of-application-under-TomEE-tp4675258.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
