Support Article
Unable to avoid inserting null values in column during Obj-Save
SA-56393
Summary
Performing Obj-Save, inserts null values in column with the below format:
'Column_name' Data_Type NOT NULL GENERATED ALWAYS AS ROW BEGIN
The requirement is to avoid inserting null values in the column.
Error Messages
[MSG][obj-save failed.][STACK][com.pega.pegarules.pub.database.BadTableMappingException: Database-General trying to store an empty property SystemStartDate to a database column that does not accept nulls From: (H5FDF9595F0DDD7927E433A836A4173A8:127.0.0.1) at com.pega.pegarules.data.internal.access.PageDatabaseMapperImpl.setStmtInsert(PageDatabaseMapperImpl.java:1873) at com.pega.pegarules.data.internal.access.PageDatabaseMapperImpl.fillInStatementFromPageWithStream(PageDatabaseMapperImpl.java:1413) at com.pega.pegarules.data.internal.access.Saver.getStatementWithPrepValues(Saver.java:1608) at com.pega.pegarules.data.internal.access.Saver.updateInstance(Saver.java:1167) at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:927) at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:803) at
........
com.pega.pegarules.data.internal.access.Saver.save(Saver.java:682) at com.pega.pegarules.data.internal.access.Saver.save(Saver.java:1899) at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:2704) at com.pegarules.generated.activity.sh_action_testsystemdate_e8276fa2524d00ad9fae77b6244fc555.step3_circum0(sh_action_testsystemdate_e8276fa2524d00ad9fae77b6244fc555.java:245) at com.pegarules.generated.activity.sh_action_testsystemdate_e8276fa2524d00ad9fae77b6244fc555.perform(sh_action_testsystemdate_e8276fa2524d00ad9fae77b6244fc555.java:88) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3559) at
Steps to Reproduce
- Log in to the application
- Perform Obj-Save of a table with generated not null column
Root Cause
A defect in Pegasystems’ code or rules.
Resolution
Here’s the explanation for the reported behavior:Pega does not support the combination of 'not null' and generated in the schema.
Published August 29, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.