Uploaded image for project: 'PUBLIC - Liferay Portal Web Content Experience'
  1. PUBLIC - Liferay Portal Web Content Experience
  2. WCM-1443

Premature closure of connection pool when updating Audience Targeting Analytics Storage settings

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 2.x
    • Fix Version/s: None
    • Component/s: Content Targeting
    • Labels:
      None

      Description

      Description
      Whenever an update is made to the Audience Targeting Analytics Storage settings in System Settings, a connection pool is closed. Another thing that happens when updating these settings is that an "Update Reports" process is fired off for every User Segment. This process appears to utilize the same connection pool each time when interacting with the database. This connection pool, however, is the same pool that gets closed the first time you update the Audience Targeting Analytics Storage settings. This leads to a stacktrace in the console, and the Update Reports process fails to complete.

      This issue also affects version 2.1.2 of Audience Targeting, released on the Marketplace. I have not tested it with earlier versions.

      Steps to Reproduce
      1. Add a User Segment that your user is a member of.
      2. Add a Web Content Display application to a page and add/configure a content to be displayed on it.
      3. Reload the page several times.
      4. Go to the user segment created in step 1. and visualize the Content View report. Click the Update option. Ensure that there is data in the report.
      5. Go to Control Panel > Configuration > System Settings > Web Experience > Audience Targeting Analytics Storage
      6. Click the Update button (I don't believe there is any need to make any changes to the settings).
      7. Observe the logs, if there are no errors, repeat steps 5-6.

      Expected Result: There are no errors in the logs.
      Actual Result: The following stacktrace appears in the logs:

      17:53:42,422 ERROR [liferay/scheduler_dispatch-9][JDBCExceptionReporter:234] HikariDataSource HikariDataSource (HikariPool-3) has been closed.
      17:53:42,425 ERROR [liferay/scheduler_dispatch-9][ParallelDestination:55] Unable to process message {destinationName=liferay/scheduler_dispatch, response=null, responseDestinationName=null, responseId=null, payload=null, values={GROUP_NAME=com.liferay.content.targeting.report.user.segment.content.internal.messaging.CheckML, companyId=0, groupId=0, DESTINATION_NAME=liferay/scheduler_dispatch, EXCEPTIONS_MAX_SIZE=0, JOB_STATE=com.liferay.portal.kernel.scheduler.JobState@7050662, STORAGE_TYPE=MEMORY_CLUSTERED, JOB_NAME=com.liferay.content.targeting.report.user.segment.content.internal.messaging.CheckML}}
      com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: could not execute query
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
              at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:66)
              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:748)
      Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: could not execute query
              at com.liferay.content.targeting.analytics.service.persistence.impl.AnalyticsEventFinderImpl.doFindByC_GTC_R_R_2(AnalyticsEventFinderImpl.java:308)
              at com.liferay.content.targeting.analytics.service.persistence.impl.AnalyticsEventFinderImpl.findByC_GtC_R_R_2(AnalyticsEventFinderImpl.java:104)
              at com.liferay.content.targeting.analytics.service.impl.AnalyticsEventLocalServiceImpl.getAnalyticsEventsWithElementId(AnalyticsEventLocalServiceImpl.java:481)
              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:498)
              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.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.$Proxy488.getAnalyticsEventsWithElementId(Unknown Source)
              at com.liferay.content.targeting.analytics.provider.impl.DefaultAnalyticsProviderImpl.getAnalyticsEventsCount(DefaultAnalyticsProviderImpl.java:82)
              at com.liferay.content.targeting.report.user.segment.content.service.impl.UserSegmentContentLocalServiceImpl.addUserSegmentContentsFromAnalytics(UserSegmentContentLocalServiceImpl.java:181)
              at com.liferay.content.targeting.report.user.segment.content.service.impl.UserSegmentContentLocalServiceImpl.checkUserSegmentContentEvents(UserSegmentContentLocalServiceImpl.java:124)
              at com.liferay.content.targeting.report.user.segment.content.service.impl.UserSegmentContentLocalServiceImpl.checkUserSegmentContentEvents(UserSegmentContentLocalServiceImpl.java:96)
              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:498)
              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.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.$Proxy524.checkUserSegmentContentEvents(Unknown Source)
              at com.liferay.content.targeting.report.user.segment.content.internal.messaging.CheckML.doReceive(CheckML.java:63)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              ... 6 more
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: could not execute query
              at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:33)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:194)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:167)
              at com.liferay.content.targeting.analytics.service.persistence.impl.AnalyticsEventFinderImpl.doFindByC_GTC_R_R_2(AnalyticsEventFinderImpl.java:305)
              ... 38 more
      Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
              at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
              at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
              at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
              at org.hibernate.loader.Loader.doList(Loader.java:2545)
              at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
              at org.hibernate.loader.Loader.list(Loader.java:2271)
              at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
              at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
              at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
              at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:182)
              ... 40 more
      Caused by: java.sql.SQLException: HikariDataSource HikariDataSource (HikariPool-3) has been closed.
              at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:81)
              at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:403)
              at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
              at com.sun.proxy.$Proxy7.prepareStatement(Unknown Source)
              at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
              at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
              at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
              at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
              at org.hibernate.loader.Loader.doQuery(Loader.java:801)
              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
              at org.hibernate.loader.Loader.doList(Loader.java:2542)
              ... 47 more
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package