cancel
Showing results for 
Search instead for 
Did you mean: 

content catalog sync error

Former Member
3,901

hi,All expert i faced an strange problem.

error occur in hybris5.7 when sync content catalog. following are error message.

ERROR [SyncWorker] (00008AM4) [AbstractItemCopyContext] could not copy data from 8796113174558 to 8796126380062 due to de.hybris.platform.persistence.hjmp.HybrisOptimisticLockingFailureException: item pk 8796126380062 was modified concurrently - expected database version 468 but got 469, entity state = GenericItemEntityState(PK=8796126380062,txbound=true,sid=79bfe67e,hjmpTS=469,hjmpTSBefore=468)

Any update on this? we are facing same issue.

Accepted Solutions (1)

Accepted Solutions (1)

andyfletcher
Active Contributor
0 Kudos

You've got optimistic locking turned on

 hjmp.throw.concurrent.modification.exceptions=true

It throws an exception if any other Hybris thread has modified the database row since you last selected from it. However, I've never worked on a project with this turned on and my understanding is that it is legacy feature that doesn't necessarily work. The default for this value in advanced.properties is false

andyfletcher
Active Contributor
0 Kudos

I knew I'd seen a post about this before

https://wiki.hybris.com/display/forum/Hybris+documentation+for+handling+of+concurrent+transactions?f...

[] Brendan Dobbs: Hi Guillaume, there is some sort of optimistic concurrency control but as far as I know it hasn't been used on projects and when I asked Axel and Andreas about it they didn't give me any confidence that it was a good idea to enable it

Former Member
0 Kudos

hi, i have tried this configuration, but errors still exist.

and i configure it in HAC.

andyfletcher
Active Contributor
0 Kudos

You've tried setting it to false? Then something must be turning it on for the thread. The only way this exception would be thrown is if optimistic locking is enabled. Do you have any code calling HJMPUtils.enableOptimisticLocking()

What result do you get if you run

 de.hybris.platform.persistence.hjmp.HJMPUtils.isOptimisticLockingEnabled()

in the hAC Groovy console? It should show false.

Former Member
0 Kudos

in hac ->platform->configration.

Former Member
0 Kudos

hjmp.throw.concurrent.modification.exceptions : default value is false in our project.

Former Member
0 Kudos

hi

i run following code ,

 de.hybris.platform.persistence.hjmp.HJMPUtils.isOptimisticLockingEnabled()

the result is false.

it seems the optimistic locking is disable. but the errors still exist.

andyfletcher
Active Contributor
0 Kudos

That's very strange. If you look at the code in GenericBMPBean.class you'll only see 2 places where this exception is thrown and for both places check whether optimistic locking is enabled. Are you using customised versions of your sync jobs? Perhaps a search across your code base for calls to HJMPUtils might throw some light?

The other option would be to disable multithreaded catalog sync, i.e. set catalog.sync.workers=1 but you'll probably notice an increase in sync times.

Former Member
0 Kudos

hi ,Andrew Fletche

thank you very much , i have deleted item pk of '8796113174558'。and now , the console has no error information 。

but deadlock info still in the synchronization interface.

just now ,i have faced the same issue in sync product catalog. but i resolve it.

following is my operation:

i saved stage data, just save and not do other things.

and next, i sync product catalog . the error message has disappeared.

Answers (6)

Answers (6)

shubham_gupta11
Explorer

I'm also facing the same issue, though the configuration is hjmp.throw.concurrent.modification.exceptions=false

Former Member
0 Kudos

Same problem on my environment.

Hello, In my case problem resolved do sync in one thread

shubham_gupta11
Explorer
0 Kudos

did you changed /added any configuration to run Sync in one thread ?

nikolay_gagov
Discoverer
0 Kudos

The only way to disable the optimistic locking during catalog sync is to blacklist the types you sync from locking via config:

synchronization.hjmp.optimistic.locking.disabled.types=Type1,Type2,...

Reason:

The CatalogVersionSyncWorker is calling internally enableAndConfigureOptimisticLocking() which will ignore the

hjmp.throw.concurrent.modification.exceptions=false
private void enableAndConfigureOptimisticLocking() {
   HJMPUtils.enableOptimisticLocking();
   HJMPUtils.setBlacklistedTypesForOptimisticLocking(Config.getString("synchronization.hjmp.optimistic.locking.disabled.types", ""));
}
priyanka_gupta2692
Participant
0 Kudos

Solution- Run CatalogSynchJob again. This logs will not come again, automatically resolved.

0 Kudos

You can do one thing to check the console log for more information. The same log is displayed in the cron job log. Catalog synchronization did not fail. Only some items have failed. It may be related to missing properties such as the names, descriptions, and translations.

Regards,
J Wick

priyanka_gupta2692
Participant
0 Kudos

Any Solution for above question?? I am also getting same issue while doing synch

priyanka_gupta2692
Participant
0 Kudos

Run full catalog synch job again, it will resolve this issue.