on ‎2018 Oct 27 12:56 PM
In our application we are updating order entrymodel in below way using modelservice.save
final List entries = new ArrayList(cartModel.getEntries());
for (int i = 0; i < entries.size(); i++) {
entries.get(i).setEntryNumber(Integer.valueOf(i));
modelService.save(entries.get(i));
}
Bot now we have replaced the code in below way. Now sometimes we are getting exception ambiguous unique keys.
final List entryList = new ArrayList();
for (int i = 0; i < entries.size(); i++) {
entries.get(i).setEntryNumber(Integer.valueOf(i));
entryList.add(entries.get(i));
}
modelService.saveAll(entryList);
exceptions:
de.hybris.platform.servicelayer.interceptor.InterceptorException:
[de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@5d68ac47]:ambiguous unique keys
{entryNumber=1, order=CartModel (8833253376043@409)} for model CartEntryModel (9033849569324@5) - found 1 item(s) using the same keys
Could you please explain why we are getting the exceptions.
Request clarification before answering.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.