Solved

Custom LU and Project - Update using PATCH - DB_OBJECT_MODIFIED error

  • 28 February 2022
  • 5 replies
  • 355 views

Userlevel 3
Badge +6

Hi,

I have a Custom Logical Unit created and a projection of type Integration created for it. I am able to retrieve the data from Postman without issues.

When I try to update using PATCH, I keep getting the following error. If I pass a non-existing objkey, then it creates a new record in the CLU.

Do I need to do anything differently to be able to modify records in the CLU?

{

    "error": {

        "code": "DB_OBJECT_MODIFIED",

        "message": "Resource already modified.",

        "details": [

            {

                "code": 20114,

                "message": "ORA-20114: TestOrderDetails.MODIFIED2: The Test Order Details for Demo object has been modified by another user. Please refresh the object and reenter your changes."

            }

        ]

    }

}

Thank You.

icon

Best answer by Dananjaya M. 5 May 2022, 12:10

View original

This topic has been closed for comments

5 replies

Userlevel 2
Badge +4

Hi @khtdinesha , All, 

 

I got the same error for PATCH call for a Custom Entity. Did you manage to resolve this? If so could you please share how did you manage to resolve?

 

Thank you and Best regards,

Ravi

Userlevel 2
Badge +8

Hi,

I am not sure whether this will be a solution but before sending the patch request did you trying adding ‘If-Match’ property to the request header?

Usually if the record is already created from the GET request you can receive the ‘@odata.etag’ like below →
 

 

Get the value for @odata.etag and Make sure to remove the red highlighted backslashes from the content as they are used to handle double quotes in JSON - W/\"Vy8iQUFBdkJNQUFHQUFCYXRHQUFDOjIwMjIwMTIyMDkxNTIzIg==\"

Then add this value to request header and send the request

 

Note that as mentioned the red-highlighted backslashes need to be removed before adding it to the header

/Dananjaya Misso.

Userlevel 2
Badge +4

Thank you @Dananjaya M. . It works like a charm..!!!

 

Userlevel 2
Badge +8

@Ravi De Silva  Great to hear 😀
@khtdinesha if the provided solution works for you as well maybe you can tag my answer as the solution 😉

Userlevel 3
Badge +6

Hi @Dananjaya M. 

Yes, it worked for me too. Thank you!