Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-79634

Update SampleSQLBuilder according to LPS-76191

Details

    Description

      After LPS-76191, set "discussion.email.comments.added.enabled=false", with high concurrency, DataIntegrityViolationException appeared on portal side with the data that generated by SampleSQLBuilder when add comment on Blog entry.

      SampleSQLBuilder needed to generate the data for DB table UserNotificationDelivery.

      2018-04-12 11:05:54.161 ERROR [liferay/subscription_sender-2][JDBCExceptionReporter:234] Duplicate entry '147-com_liferay_comment_web_portlet_CommentPortlet-0-0-10002' for key 'IX_8B6E3ACE'
      11:05:54.340 [elasticsearch[diSyC1p][masterService#updateTask][T#1]] INFO  org.elasticsearch.cluster.metadata.MetaDataMappingService - [liferay-143/BcDSuyBDT325oEYKTgcBJA] update_mapping [LiferayDocumentType]
      2018-04-12 11:05:54.287 ERROR [liferay/subscription_sender-1][SubscriptionSender:147] Unable to process subscription: {mvccVersion=0, subscriptionId=21498, groupId=0, companyId=143, userId=147, userName=Sample, createDate=2018-04-02 15:43:53.0, modifiedDate=2018-04-02 15:43:53.0, classNameId=12, classPK=578, frequency=instant}
      org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [insert into UserNotificationDelivery (mvccVersion, companyId, userId, portletId, classNameId, notificationType, deliveryType, deliver, userNotificationDeliveryId) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
      	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:659)
      	at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:800)
      	at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:670)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._commit(DefaultTransactionExecutor.java:128)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.commit(DefaultTransactionExecutor.java:36)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy288.addUserNotificationDelivery(Unknown Source)
      	at com.liferay.portal.service.impl.UserNotificationDeliveryLocalServiceImpl.getUserNotificationDelivery(UserNotificationDeliveryLocalServiceImpl.java:104)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:47)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:39)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.cache.thread.local.ThreadLocalCacheAdvice.invoke(ThreadLocalCacheAdvice.java:48)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy288.getUserNotificationDelivery(Unknown Source)
      	at com.liferay.portal.kernel.service.UserNotificationDeliveryLocalServiceUtil.getUserNotificationDelivery(UserNotificationDeliveryLocalServiceUtil.java:281)
      	at com.liferay.portal.kernel.notifications.BaseUserNotificationHandler.isDeliver(BaseUserNotificationHandler.java:122)
      	at com.liferay.portal.kernel.notifications.UserNotificationManagerUtil._isDeliver(UserNotificationManagerUtil.java:316)
      	at com.liferay.portal.kernel.notifications.UserNotificationManagerUtil.isDeliver(UserNotificationManagerUtil.java:113)
      	at com.liferay.portal.kernel.util.SubscriptionSender.sendUserNotification(SubscriptionSender.java:892)
      	at com.liferay.portal.kernel.util.SubscriptionSender.sendNotification(SubscriptionSender.java:872)
      	at com.liferay.portal.kernel.util.SubscriptionSender.notifyPersistedSubscriber(SubscriptionSender.java:658)
      	at com.liferay.portal.kernel.util.SubscriptionSender.notifyPersistedSubscriber(SubscriptionSender.java:592)
      	at com.liferay.portal.kernel.util.SubscriptionSender.flushNotifications(SubscriptionSender.java:144)
      	at com.liferay.subscription.internal.messaging.SubscriptionSenderMessageListener.doReceive(SubscriptionSenderMessageListener.java:56)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
      	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
      	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
      	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      	at com.liferay.portal.dao.orm.hibernate.event.NestableFlushEventListener.onFlush(NestableFlushEventListener.java:61)
      	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
      	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
      	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
      	at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:662)
      	... 58 more
      Caused by: java.sql.BatchUpdateException: Duplicate entry '147-com_liferay_comment_web_portlet_CommentPortlet-0-0-10002' for key 'IX_8B6E3ACE'
      	at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2054)
      	at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1467)
      	at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
      	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
      	at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
      	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
      	... 66 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '147-com_liferay_comment_web_portlet_CommentPortlet-0-0-10002' for key 'IX_8B6E3ACE'
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
      	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      	at com.mysql.jdbc.Util.getInstance(Util.java:386)
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)
      	at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2006)
      	... 71 more
      

      Attachments

        Issue Links

          Activity

            People

              brian.chan Brian Chan
              lily.chi Lily Chi
              Marta Elicegui Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                4 years, 41 weeks, 5 days ago

                Packages

                  Version Package
                  7.0.X
                  7.1.0 Beta 1
                  7.1.X
                  Master