Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.1-beta3
    • Component/s: Persistence
    • Labels:
      None
    • Testcase included:
      yes

      Description

      In the attached example code:

      • Chat hasMany Sentence
      • Sentence hasOne SSubject
      • Sentence hasOne SObject
      • Sentence hasOne SPredicat
      • SSubject, SObject, SPredicat inherit from PartOfSentence
      • PartOfSentence hasOneWord

      The One-To-One-Relations between Sentence and the PartOfSentence's breaks (see class ChatIntegrationTests, line 19):

       
      not-null property references a null or transient value: SObject.sentence; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: SObject.sentence
      
      org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: SObject.sentence; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: SObject.sentence
      at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:628)
      at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:378)
      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
      at org.codehaus.groovy.grails.orm.hibernate.metaclass.SavePersistentMethod.performSave(SavePersistentMethod.java:52)
      at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractSavePersistentMethod.doInvokeInternal(AbstractSavePersistentMethod.java:109)
      at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod.invoke(AbstractDynamicPersistentMethod.java:51)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:765)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernateGrailsPlugin$_addBasicPersistenceMethods_closure56.doCall(HibernateGrailsPlugin.groovy:521)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.Closure.call(Closure.java:292)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:72)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:195)
      at ChatIntegrationTests.testSavesCascading(ChatIntegrationTests.groovy:15)
      at org.codehaus.groovy.grails.support.GrailsTestSuite.runTest(GrailsTestSuite.java:72)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:765)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at TestApp_groovy$_run_closure8_closure18_closure19_closure20.doCall(TestApp_groovy:223)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at TestApp_groovy$_run_closure8_closure18_closure19_closure20.doCall(TestApp_groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.Closure.call(Closure.java:292)
      at groovy.lang.Closure.call(Closure.java:287)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeClosure(ScriptBytecodeAdapter.java:598)
      at TestApp_groovy$_run_closure10_closure28_closure29.doCall(TestApp_groovy:353)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.Closure.call(Closure.java:292)
      at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:48)
      at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:72)
      at $Proxy3.doInTransaction(Unknown Source)
      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:765)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at TestApp_groovy$_run_closure10_closure28.doCall(TestApp_groovy:365)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at TestApp_groovy$_run_closure10_closure28.call(TestApp_groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeClosure(ScriptBytecodeAdapter.java:598)
      at TestApp_groovy$_run_closure8_closure18_closure19.doCall(TestApp_groovy:221)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.Closure.call(Closure.java:292)
      at groovy.lang.Closure.call(Closure.java:305)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(DefaultGroovyMethods.java:8161)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.withOutputStream(DefaultGroovyMethods.java:7738)
      at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:51)
      at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:54)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:765)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at TestApp_groovy$_run_closure8_closure18.doCall(TestApp_groovy:196)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.Closure.call(Closure.java:292)
      at groovy.lang.Closure.call(Closure.java:305)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(DefaultGroovyMethods.java:8161)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.withOutputStream(DefaultGroovyMethods.java:7738)
      at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:51)
      at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:54)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:765)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at TestApp_groovy$_run_closure8.doCall(TestApp_groovy:195)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at TestApp_groovy$_run_closure8.call(TestApp_groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeClosure(ScriptBytecodeAdapter.java:598)
      at TestApp_groovy$_run_closure10.doCall(TestApp_groovy:338)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:94)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at TestApp_groovy$_run_closure10.doCall(TestApp_groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at groovy.lang.Closure.call(Closure.java:292)
      at groovy.lang.Script.invokeMethod(Script.java:87)
      at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:934)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:881)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:94)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0(ScriptBytecodeAdapter.java:109)
      at TestApp_groovy$_run_closure3.doCall(TestApp_groovy:117)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:94)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at TestApp_groovy$_run_closure3.doCall(TestApp_groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at groovy.lang.Closure.call(Closure.java:292)
      at groovy.lang.Script.invokeMethod(Script.java:87)
      at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:934)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:881)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:94)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0(ScriptBytecodeAdapter.java:109)
      at TestApp_groovy$_run_closure1.doCall(TestApp_groovy:63)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:94)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at TestApp_groovy$_run_closure1.doCall(TestApp_groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at groovy.lang.Closure.call(Closure.java:292)
      at groovy.lang.Closure.call(Closure.java:287)
      at groovy.lang.Closure.run(Closure.java:368)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
      at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:79)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:195)
      at gant.Gant.dispatch(Gant.groovy:271)
      at gant.Gant.this$2$dispatch(Gant.groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:675)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at gant.Gant.invokeMethod(Gant.groovy)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at gant.Gant.processTargets(Gant.groovy:436)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
      at gant.Gant.processArgs(Gant.groovy:372)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
      at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.groovy:204)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
      at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)
      at groovy.lang.ExpandoMetaClass.invokeStaticMethod(ExpandoMetaClass.java:957)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeStaticMethod(InvokerHelper.java:800)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeStaticMethodN(ScriptBytecodeAdapter.java:212)
      at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.groovy:124)
      at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:140)
      at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:169)
      Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: SObject.sentence
      at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
      at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
      at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:218)
      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
      at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:431)
      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265)
      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
      at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
      at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:218)
      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
      at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
      at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:456)
      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:334)
      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
      at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
      at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495)
      at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1238)
      at $Proxy5.saveOrUpdate(Unknown Source)
      at org.codehaus.groovy.grails.orm.hibernate.metaclass.SavePersistentMethod$1.doInHibernate(SavePersistentMethod.java:54)
      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
      

        Activity

        Hide
        Graeme Rocher added a comment -

        The problem here is that you have a bidirectional one-to-one between Sentence and PartOfSentence where both sides of the relationship are not nullable, this is problematic because it prevents you from being able to save either side. In other words you can't save a Sentence without persisted PartOfSentence instances (for SObject, SPredict etc.) and you can't save the PartOfSentence instances without a Sentence so you have a catch22.

        The solution is to make one side of the relationship nullable so that you can first save the sentence then assign the other side then save each PartOfSentence

        Show
        Graeme Rocher added a comment - The problem here is that you have a bidirectional one-to-one between Sentence and PartOfSentence where both sides of the relationship are not nullable, this is problematic because it prevents you from being able to save either side. In other words you can't save a Sentence without persisted PartOfSentence instances (for SObject, SPredict etc.) and you can't save the PartOfSentence instances without a Sentence so you have a catch22. The solution is to make one side of the relationship nullable so that you can first save the sentence then assign the other side then save each PartOfSentence
        Hide
        Stefan Roock added a comment -

        Ah. OK, I understand the problem and you are right. But that's hard to understand at first and to remember.

        Is it possible to get a better error message with a clear hint about the root cause of the problem?

        Show
        Stefan Roock added a comment - Ah. OK, I understand the problem and you are right. But that's hard to understand at first and to remember. Is it possible to get a better error message with a clear hint about the root cause of the problem?
        Hide
        Stefan Roock added a comment -

        I would understand the reason if you wouldn't have transactions. But I would expect that the objects are stored within a transaction and then it should be possible to have ONE-TO-ONE with non-nullable.

        Show
        Stefan Roock added a comment - I would understand the reason if you wouldn't have transactions. But I would expect that the objects are stored within a transaction and then it should be possible to have ONE-TO-ONE with non-nullable.
        Hide
        Lee Butts added a comment -

        Changed fix version to unreleased version

        Show
        Lee Butts added a comment - Changed fix version to unreleased version
        Hide
        Graeme Rocher added a comment -

        Reduced priority of non critical issues which have current workarounds

        Show
        Graeme Rocher added a comment - Reduced priority of non critical issues which have current workarounds
        Hide
        Graeme Rocher added a comment -

        This is now fixed, since we map a bidirectional one-to-one to a single foreign key column instead of two now

        Show
        Graeme Rocher added a comment - This is now fixed, since we map a bidirectional one-to-one to a single foreign key column instead of two now

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Stefan Roock
          • Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development