Hello! I did an upgrade from Grails 3.3.2 to 6.2....
# questions
j
Hello! I did an upgrade from Grails 3.3.2 to 6.2.0, moving from java 8 to java 11 and from web profile to api-rest profile. I get everything up and running until I tried to save() an entity. At this point the application hangs forever. Then I tried with save(validation:false) and it worked. So the problem comes with the validation (nothing changed from the old project so there's no problem with the logic). My question is what could bring to this problem? Java version, Hibernate version, GORM version, Grails version? Thanks
imagen.png
It seems to hang on this method
This is the stack
Copy code
http-nio-8090-exec-3
app//groovy.lang.NumberRange$StepIterator.hasNext(NumberRange.java:581)
app//groovy.lang.NumberRange.contains(NumberRange.java:522)
app//org.grails.datastore.gorm.validation.constraints.RangeConstraint.processValidate(RangeConstraint.java:56)
app//org.grails.datastore.gorm.validation.constraints.AbstractConstraint.validate(AbstractConstraint.java:88)
app//grails.gorm.validation.DefaultConstrainedProperty.validate(DefaultConstrainedProperty.groovy:601)
app//grails.gorm.validation.PersistentEntityValidator.validatePropertyWithConstraint(PersistentEntityValidator.groovy:305)
app//grails.gorm.validation.PersistentEntityValidator.cascadeValidationToOne(PersistentEntityValidator.groovy:246)
app//grails.gorm.validation.PersistentEntityValidator.cascadeToAssociativeProperty(PersistentEntityValidator.groovy:116)
app//grails.gorm.validation.PersistentEntityValidator.cascadeValidationToOne(PersistentEntityValidator.groovy:261)
app//grails.gorm.validation.PersistentEntityValidator.cascadeToAssociativeProperty(PersistentEntityValidator.groovy:116)
app//grails.gorm.validation.PersistentEntityValidator.validate(PersistentEntityValidator.groovy:82)
app//org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.save(AbstractHibernateGormInstanceApi.groovy:124)
app//org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:153)
org.grails.datastore.gorm.GormEntity$Trait$Helper$save$7.call(Unknown Source)
app//org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
app//org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
app//org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
marketinginsiders.LogBusqueda.save(LogBusqueda.groovy)
I tried with save(validate:true, deepValidate:false) and now it's working. Any idea why it doesn't work?
j
You can check dependency versions against the following. Since deepValidate:false works, how many associations of the domain instance your are trying to save exist?
👍 1
j
Thanks for your reply 🙂 Which dependency should be aware of? I'm trying to save the domain instance with 20 associations also not saved. So it should be saving these 20 associations and the domain class too.