Hello Folks,
I am getting this error while write to Data store entity.:"An error occurred while trying to write to the data store. No values have been written. Details: org.hibernate.PropertyValueException: not-null property references a null or transient value :"
Can anyone help me on this? Actually I want one column in a table is non nullable that is also behave as a foreign key.
Thanks
Discussion posts and replies are publicly visible
You have columns in database which are defined as Non-Nullable. Which means it cannot be empty and looks like you have no value being saved, hence the error. Please share the DB structure and the PV data if possible.
Please see db structure:
Valuationid is not null field as it should not be empty or null.
As a prior reply already noted, your tomcat-stdout.log file should contain an explanation as to what the actual missing column is.
Did you check your failed process instance data to ensure that the CDT value is properly populated? Could you post a screenshot of it here?
this valuationid column is a foriegn key. Value is not populated but the parent table value properly entered into a table.
manjit.1486 said: Value is not populated but the parent table value properly entered into a table.
Where do you mapping the valuationId ?? Only when using Records (With relationships) FK Values gonna map automatically . But you are using CDT's , So you need to map it and then write it through datastore
Okay, let me try.
Don't use Write to Multiple Datastore entities when there is a Parent-Child relation. I don't think it has the leverage to auto map Foreign keys like Write records.
Here is the approach you need follow
1. Write to Parent table first , Use stored values and map the FK and then write to child
Working with flat Cdt's
I have modified process. But it didn't work as expected. In valuation table id column is autoincremented and primary key.In valuation doc table valuationid column is foreign key
manjit.1486 said:But it didn't work as expected.
your modified process flow looks correct. are you capturing the written "valuation" value back to the PV? This *must* be done via the "stored values" setting in the Outputs tab.
1.In Write to Valuation output tab save back what has been written . Use same Pv (Parent table variable)
2. in Script task
stored as pv!caseDocument.valuationid
then write it
manjit.1486 said:Column is already a NOT NULL
What he meant is make it NULL
Venkat Avuluri said:What he meant is make it NULL
oops, yup my bad
Yes, I am doing the same. Actually when I copied the node I forget to remove from the input tab. It works perfectly now. Thank you so much.
I kept it as it is. NOT NULL. It worked.
Yep, as long as you populate it before your first attempt to write a row, that'll work fine. The only reason you'd change this is if you wanted to write the row and then populate the FK later for some reason.
manjit.1486 said:I kept it as it is. NOT NULL
Glad to know, It's always error from process and the way it designed . Just remember don't use write to multiple datastore entity for writing new entry when there is Parent -child relationship
Okay, got it.
Hi Mike, I get the same error and all the FKs are NULL in my case. Can you look into this and suggest