Can not update existing data after changing CDT org.hibernate.ObjectDeletedException

Hi,

I have a complex CDT structures in the Processes. Earlier i was able to save retrieve and update the data. i made few changes to the CDT and now save a nd retrieve works but I cant update an existing data. I get an exception on "Write to DataStore Node".

I have verified in the process models all pvs and sub-process mappings refer to the latest cdts. I was succesfull in saving the Processes and publishing them eliminating the chances of missing some previous references to the CDT(I think).

The alert and server logs dont specify much but say some deleted object will be recreated.

Here is what i get in the alerts
"There is a problem with task “Write to Data Store Entity” in the process “ Initiate Request”. An error occurred while trying to write to the entity “CK_Request_ET” [id=b886d2c3-19ad-49c2-996a-dccaf4845d09@59999, type=Request (id=12412)] (data store: CK_DATA_STORE). Details: org.hibernate.ObjectDeletedException: deleted object would ...

OriginalPostID-128485

OriginalPostID-128485

  Discussion posts and replies are publicly visible

  • ...be re-saved by cascade (remove deleted object from associations): [CKGridColumnQuestionsDT7682#137] "

    Regards,
    Manish
  • I also tried deploying it to a fresh environment where there there was no existing CDTs or tables to see if I get rid of some deleted objects being referred to.

    I am getting the same exception there also.
    Please advise.
  • Hi Eduardo,
    PFA the zip containing all the xsds. We are getting the error while trying to update the value saved via our top level CDT (Request CDT).

    XSDs.zip

  • Hi Eduardo,
    Last time we were able to resolve it by recreating the CDTs and mapping it again.

    now it is working in the dev env but when we tried an import to QA env the DB functionality broke again. last time(after remapping of new CDTs) we did an import to the QA and it worked for this env also.

    Now, it is throwing exceptions for constraint violation for choices table(Id, not null).
    We are having multiple choices(text) inside Question and trying to fetch and persist data through parent object request itself.

    We have 4 levels of nesting between Request and choices.(Request->KYA Details->Categories->Questions->choices)
    Is the level of nesting the reason for this constraint violation?

    Also I dont understand why this constraint is being violated. If an id is not there appian should autogenerate it and insert the values as it does in the first time when we persist the values. It only breaks at the time of an update. Then also its not consistent across the environments
  • What's the exact error you're getting? If it's an update, then it should be using the original/existing primary key, right? or doe the update include inserting new children?
  • It should be an update.

    Error : There is a problem with task “Enter Collect Status” in the process “BW_CK_START01182”. An error occurred while trying to write to the entity “CBG_CDD_Request_ET”
    [id=67850886-6197-4292-ac4b-e725d3338231@21306, type=CBG_CDD_Request (id=4672)] (data store: CBG_CDD_DATASTORE). Details: org.hibernate.exception.ConstraintViolationException:
    Could not execute JDBC batch update: java.sql.BatchUpdateException: ORA-00001: unique constraint (APPIAN_BUSINESS.SYS_C0011202) violated Data: TypedValue[it=4672,v={3,1183,TestRequestType,TestClientName,
    TestUniqueIdentifier,TestProduct,,....................

    But as I mentioned its text type with multiple occurrence, so we are not creating table for it. In turn appian is creating to maintain the multiple choices inside a question type.
    in some questions that dont have choice it is empty and in others it is either single or multiple.
    I am attaching the request object for your reference. you can see choices in question.

    just mentioning again, In our dev env it is working as expected. And even on QA it was good before the import

    RequestValues.txt

  • To me it looks like it's trying to do an insert instead of an update and this can happen if you are manually populating the primary key field in the process instead of passing the entire pv
  • No Eduardo,
    Its not an insertion. we are not touching the id column.

    moreover it works seamlessly on dev environment. We create new entries update them and it works absolutely fine.
  • @ Manish, do you have the resolution for this issue. As I am facing the same problem. In my case I have a multiple type CDT which is having two records - one with primary key (For update) and one without primary key (For Insert) and I am getting the exact same exception, I have verified that the row which I am trying to insert is having in primary key column of CDT and the other record in having primary key which I want to update. I have also verified xsd - it has @GeneratedValue attribute set for the @Id column.