jdaugherty commented on issue #15276:
URL: https://github.com/apache/grails-core/issues/15276#issuecomment-3661208239

   I was thinking of several features after this discussion: 
   
   1. save(validate: false) => flags that specific instance to not validate on 
flush
   2. `@Transactional` will have a new attribute skipValidateOnFlush - false is 
the default.  if true, we could either skip validation on all flushes or only 
at the end of the transaction
   3. `@Transactional` will have a new attribute skipValidateFor - defaults to 
empty list.  Takes a list of domain classes that will simply not validate *at 
all* on save or flush.
   4. Suggest that the user modifies their custom constraint to bypass that 
validation based on their desired behavior.
   
   Thoughts on these options: 
   - The problem with 1. is how do you handle cascades?  
   - For 2, we would need to decide if its only the end of transaction flush or 
any flush (thus, only calling save explicitly would validate).
   - 3 is probably the easiest since it's on / off and very clear what happens.
   - obviously easier for Grails, inconvenient for end users. 
   
   It sounds like 3 would solve the general problem here though & it's actually 
the most well defined.  Do you agree?


-- 
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