Re: [hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-06 Thread Scott Marlow
On Tue, Jun 5, 2018 at 3:38 PM, Luis Barreiro wrote: > My reading on that javadoc is that you only get the transformation once > (the first time that a class is loaded) and after that, if it's used by > other PUs, it may not get the transformations those PUs specify. > We added TRACE logging

Re: [hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-05 Thread Luis Barreiro
My reading on that javadoc is that you only get the transformation once (the first time that a class is loaded) and after that, if it's used by other PUs, it may not get the transformations those PUs specify. I would like to add that the enhancer is synchronous (it only enhance one class at a

Re: [hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-05 Thread Scott Marlow
On Tue, Jun 5, 2018 at 1:06 PM, Sanne Grinovero wrote: > On 5 June 2018 at 14:43, Scott Marlow wrote: > > The PersistenceUnitInfo#addTransformer javadoc [1] mentions: > > > > " > > Add a transformer supplied by the provider that will be called for every > > new class definition or class

Re: [hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-05 Thread Scott Marlow
Thanks, I think they probably intended that the persistence provider would use a marker interface like org.hibernate.engine.spi.Managed to ensure that the enhancement is only done once. Responses to your questions are inline below. On Tue, Jun 5, 2018 at 12:19 PM, Luis Barreiro wrote: > Hi

Re: [hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-05 Thread Sanne Grinovero
On 5 June 2018 at 14:43, Scott Marlow wrote: > The PersistenceUnitInfo#addTransformer javadoc [1] mentions: > > " > Add a transformer supplied by the provider that will be called for every > new class definition or class redefinition that gets loaded by the loader > returned by the

Re: [hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-05 Thread Luis Barreiro
Hi Scott, In the particular case of the hibernate bytecode enhancer, it adds the org.hibernate.engine.spi.Managed marker interface to the entity so that it only performs the enhancement once. (that implies that you can't have the same entity enhanced for different features in the same class

[hibernate-dev] What should be the contract for PersistenceUnitInfo#addTransformer with regard to multiple persistence units mapping the same entity class?

2018-06-05 Thread Scott Marlow
The PersistenceUnitInfo#addTransformer javadoc [1] mentions: " Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the getClassLoader()