Skip to content

It's not possible to update investigations with parameters through the REST API #276

@WHTaylor

Description

@WHTaylor

Hi, I was getting some errors last week whilst trying to update some investigations on our ICAT instance via the REST API. I eventually worked out that it was only failing on investigations which had parameters, and found the cause in InvestigationParameter::preparePersist:

After this, the entity manager tries to merge the entity back into the database with a call to flush() which fails because the primary key can't be null (EntityBeanManager:2102). It works when creating new investigations because persist() generates a new ID for anything without one. It also works through the SOAP API, because EntityBeanManager::update doesn't use preparePersist.

Would it be possible to remove the problem line entirely? InvestigationParameter is the only entity which does this, and it doesn't seem like useful behaviour, but it's been around since 2014 so possibly something depends on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions