Write to Data Store Entity failing with - object is an unsaved transient instance - save the transient instance before merging

I am getting an error like - Details: org.hibernate.TransientObjectException: object is an unsaved transient instance - save the transient instance before merging: IAFCharacterDetailsAllegiancesDT6280 - while writing to a data store entity.

I have checked the child CDT, no values are being passed as null. Still no clue why am I getting this error. Can anyone help?

  Discussion posts and replies are publicly visible

Parents
  • Hi saksheer,

    go to parent CDT, click on key in row where is your reference to child CDT and check if you have set correct field relationship. I think you need Cascade=ALL behaviour.
  • : I checked the "Updates to a parent value should also update associated child value(s)" in the Foreign Key setup. This helped me get rid of this error.

    However, it says that "This field has a One-to-Many relationship and Master-Detail (Cascade=ALL) behavior" - which should ideally mean that any update on parent should be "cascaded" to the child CDT too. But when I try to truncate the table for parent CDT from MYSQL, it does not let me do it, because of the foreign key constraint. I checked the relationship in the table for child CDT, the foreign key constraint is "restrict". Why is it restrict when the relationship in the CDT clearly says Cascade=ALL?
Reply
  • : I checked the "Updates to a parent value should also update associated child value(s)" in the Foreign Key setup. This helped me get rid of this error.

    However, it says that "This field has a One-to-Many relationship and Master-Detail (Cascade=ALL) behavior" - which should ideally mean that any update on parent should be "cascaded" to the child CDT too. But when I try to truncate the table for parent CDT from MYSQL, it does not let me do it, because of the foreign key constraint. I checked the relationship in the table for child CDT, the foreign key constraint is "restrict". Why is it restrict when the relationship in the CDT clearly says Cascade=ALL?
Children