cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OData IntegrationObjectItemAttribute with autoCreate=true creating duplicate objects

rdsa
Discoverer
0 Likes
535

Hello,

I have an OData Integration (not using $batch) for products that sometimes is called multiple times at once and this is causing the following problem:

ProductModel has a many to many relation with another Model (I'll call it FooModel in this example). FooModel is pretty simple, just a few attributes including a code (unique) and a boolean flag (also unique) among others.

FooModel is being created during this OData integration (the IntegrationObjectItemAttribute of this attribute has autoCreate set to true). This works fine if I send a single request but if I send two or more requests (with the same FooModels) at the same time I'll get two (or however many requests I sent at the same time) FooModels. They are exact copies, with the same code and boolean flags (even though those are unique) and the requests do not fail, the response has a success status.

Then after this if I send another request that includes this duplicated FooModel the request fails and throws an exception:

de.hybris.platform.integrationservices.search.NonUniqueItemFoundException: No unique item found for Foo: ...

Any ideas on how to solve this? Commerce version 1905.13.

Accepted Solutions (0)

Answers (0)