|
Hi @Steve Ebersole,
Sorry for not getting back earlier, finally managed to have a look and do some tests today.
You explicitly manage TCCL in OsgiPersistenceProviderService#getService() [1] I think you could leave this out as this method only creates an instance of the OsgiPersistenceProvider for the "requestingBundle". If managing TCCL is still required for bootstrapping an EMF this needs to be done in the OsgiPersistenceProvider
I've also tried this new version and had an issue with creating a container managed EntityManagerFactory, no errors when creating but when I try to use it I get exceptions like:
java.lang.IllegalArgumentException: Type specified for TypedQuery [org.amdatu.jpa.demo.service.JpaDemoRecord] is incompatible with query return type [class org.amdatu.jpa.demo.service.JpaDemoRecord]
javax.persistence.PersistenceException: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Long org.amdatu.jpa.demo.service.JpaDemoRecord.id] by reflection for persistent property [org.amdatu.jpa.demo.service.JpaDemoRecord#id] : org.amdatu.jpa.demo.service.JpaDemoRecord@66063cc6
This doesn't happen when I change the PersistenceUnitInfo#getNewTempClassLoader() method and never return a temp ClassLoader there.
1: https://github.com/hibernate/hibernate-orm/blob/master/hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiPersistenceProviderService.java#L45
|