Skip to content

Commit

Permalink
Fix for GRAILS-4843 "Occasional StackOverflow when perform binding us…
Browse files Browse the repository at this point in the history
…ing properties = params"
  • Loading branch information
graemerocher committed Sep 15, 2009
1 parent 9c87f77 commit 3df4414
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Expand Up @@ -33,7 +33,7 @@ class DomainClassGrailsPlugin {

def version = grails.util.GrailsUtil.getGrailsVersion()
def dependsOn = [i18n:version]
def loadAfter = ['hibernate', 'controllers']
def loadAfter = ['controllers']

def doWithSpring = {
for(dc in application.domainClasses) {
Expand Down
Expand Up @@ -402,15 +402,6 @@ Try using Grails' default cache provider: 'org.hibernate.cache.OSCacheProvider'"

Validator validator = ctx.containsBean("${dc.fullName}Validator") ? ctx.getBean("${dc.fullName}Validator") : null
def validateMethod = new ValidatePersistentMethod(sessionFactory, application.classLoader, application,validator)

MetaProperty originalPropertiesProperty = metaClass.getMetaProperty("properties")
metaClass.setProperties = {Object o ->
originalPropertiesProperty.setProperty delegate, o
if(delegate.hasErrors()) {
GrailsHibernateUtil.setObjectToReadyOnly delegate,sessionFactory
}
}

metaClass.validate = {->
validateMethod.invoke(delegate, "validate", [] as Object[])
}
Expand Down

0 comments on commit 3df4414

Please sign in to comment.