SAP Knowledge Base Article - Preview

2496348 - DataHub database deadlock

Symptom

The compositions get stuck randomly in status remain IN_PROGRESS. i.e. No further feed processing happen.

The problem happens within "com.hybris.datahub.repository.jpa.impl.DefaultPublicationRetryJpaRepository.deleteInBatchByCanonicalItemId" method as two transactions are attempting to access the "PublicationRetry" table. 

The error would look like below:

javax.persistence.PersistenceException: org.hibernate.exception.LockAcquisitionException: could not execute statement
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1771) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
  at org.hibernate.jpa.spi.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:87) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
  at com.hybris.datahub.repository.jpa.impl.DefaultPublicationRetryJpaRepository.deleteInBatchByCanonicalItemId(DefaultPublicationRetryJpaRepository.java:261) ~[datahub-service-6.2.0.1-RC1.jar:6.2.0.1-RC1]
  at com.hybris.datahub.repository.jpa.impl.DefaultPublicationRetryJpaRepository.dt_access$576(DefaultPublicationRetryJpaRepository.java) ~[datahub-service-6.2.0.1-RC1.jar:6.2.0.1-RC1]
  at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[na:1.8.0_92]
  at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[na:1.8.0_92]
  at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[na:1.8.0_92]
A  at com.hybris.datahub.repository.jpa.impl.DefaultPublicationRetryJpaRepository.removeCanonicalItemPublicationRetryEntries(DefaultPublicationRetryJpaRepository.java:248) ~[datahub-service-6.2.0.1-RC1.jar:6.2.0.1-RC1
.................................................

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction


Read more...

Environment

Datahub version 6.2, 6.3

Hybris version  5.7, 6.1, 6.2 

Product

SAP Commerce all versions

Keywords

datahub, ignored status, publication, deadlock, custom publication, grouping handler,  , KBA , CEC-COM-HUB , SAP Commerce Data Hub , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.