jdaugherty commented on PR #14670:
URL: https://github.com/apache/grails-core/pull/14670#issuecomment-2831362071

   One of my discoveries  with this change is that the Gorm transforms expect 
to alternate;  that is if you have the following nodes to visit: 
   
               ClassNode BookService
               MethodNode countBooks
   
   Then it's expected that the application order be: 
   
               For Class Node, apply Transactional Transform & Tenant Transform 
(simplified)
               For Method Node, apply Transactional Transform & Tenant 
Transform (simplified)
   
   The Groovy 4 improvement (TransformWithPriority) is to apply in this order: 
   
               1. Class Node - Transactional Transform
               2. Method Node - Transactional Transform
               3. Class Node - Tenant Transform
               4. Method Node - Tenant Transform
   
   We can't completely switch to the to TransformWithPriority because the 
transaction transform looks for values set by the previous visit to Class node. 
 You would get an error similar to "BookService#tenantId access is forbidden" 
and it would fail to compile. 
   
   I've gone ahead and tried to document the run order in GroovyTransformOrder, 
and since both the groovy 4 TransformWithPriority & the grails datastore 
Ordered expect a higher value to be higher priority, they can be used 
interchangeably.  
   
   I major side effect of this change is the transforms should still be applied 
in the same order, every time.  This should eliminate side effect compile 
behavior where they would execute in a different order pre groovy 4.  
   
   Also, there is still differences amongst a generated domain class after this 
change.  I've tried to switch to ordered collections where possible, but 
there's still something along the domain path that's cause it to be different 
each time.  I am continuing to research ...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to