Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-3708

RS: email subscription error

    XMLWordPrintable

    Details

      Description

      For every email send, we subscribe the recipient to the emails notifications automatically. If an error happens during the subscription (which happens only once per user and is a nice to have feature), the process is broken. The solution to mitigate the issue is to subscribe to the notifications in an asynchronous way.

      Follow an example of a possible error:

      2018-10-25 15:00:29,457 [ajp-nio2-8021-exec-106] ERROR DBRuntimeException - OLAT::ERROR ^%^ N1-E60 ^%^ org.olat.core.logging 
      https://xyz.de/auth/RepositoryEntry/578912320/CourseNode/98532318016331
      Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36
      
      **RedScreen** commit failed, rollback transaction
      
      <dispatchinfo>
      	<componentinfo>
      		<compname>table</compname>
      		<compclass>org.olat.core.gui.components.table.Table</compclass>
      		<extendedinfo>n/a</extendedinfo>
      		<event>
      			<class&gt;org.olat.core.gui.components.table.TableEvent</class&gt;
      			<command>r</command>
      			<tostring>cmd:r, rowId:11, actionId:cmd.enrolled.cancel</tostring>
      		</event>
      	</componentinfo>
      	<controllerinfo>
      		<controllername>org.olat.core.gui.components.table.TableController</controllername>
      		<controllername>org.olat.course.nodes.en.ENRunController</controllername>
      		<controllername>org.olat.course.run.RunMainController</controllername>
      		<controllername>org.olat.course.run.CourseRuntimeController</controllername>
      		<controllername>org.olat.core.commons.fullWebApp.BaseFullWebappController</controllername>
      	</controllerinfo>
      </dispatchinfo>
      
      >>> stack of 1.cause::org.olat.core.logging.DBRuntimeException: commit failed, rollback transaction
      -> at org.olat.core.commons.persistence.DBImpl.commit(DBImpl.java:591)
         at org.olat.core.commons.services.notifications.manager.NotificationsManagerImpl.subscribe(NotificationsManagerImpl.java:910)
         at org.olat.core.util.mail.manager.MailManagerImpl.subscribe(MailManagerImpl.java:210)
         at org.olat.core.util.mail.manager.MailManagerImpl.saveDBMessage(MailManagerImpl.java:1055)
         at org.olat.core.util.mail.manager.MailManagerImpl.sendMessage(MailManagerImpl.java:702)
         at org.olat.group.manager.BusinessGroupMailing.sendEmail(BusinessGroupMailing.java:146)
         at org.olat.group.manager.BusinessGroupServiceImpl.transferFirstIdentityFromWaitingToParticipant(BusinessGroupServiceImpl.java:1478)
         at org.olat.group.manager.BusinessGroupServiceImpl.removeParticipant(BusinessGroupServiceImpl.java:1051)
         at org.olat.group.manager.BusinessGroupServiceImpl.removeParticipants(BusinessGroupServiceImpl.java:1141)
         at org.olat.course.nodes.en.EnrollmentManager.doCancelEnrollment(EnrollmentManager.java:133)
         at org.olat.course.nodes.en.ENRunController.event(ENRunController.java:235)
      >>> stack of 2.cause::javax.persistence.RollbackException: Error while committing the transaction
      -> at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:77)
         at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:71)
         at org.olat.core.commons.persistence.DBImpl.commit(DBImpl.java:548)
         at org.olat.core.commons.services.notifications.manager.NotificationsManagerImpl.subscribe(NotificationsManagerImpl.java:910)
         at org.olat.core.util.mail.manager.MailManagerImpl.subscribe(MailManagerImpl.java:210)
         at org.olat.core.util.mail.manager.MailManagerImpl.saveDBMessage(MailManagerImpl.java:1055)
         at org.olat.core.util.mail.manager.MailManagerImpl.sendMessage(MailManagerImpl.java:702)
         at org.olat.group.manager.BusinessGroupMailing.sendEmail(BusinessGroupMailing.java:146)
         at org.olat.group.manager.BusinessGroupServiceImpl.transferFirstIdentityFromWaitingToParticipant(BusinessGroupServiceImpl.java:1478)
         at org.olat.group.manager.BusinessGroupServiceImpl.removeParticipant(BusinessGroupServiceImpl.java:1051)
         at org.olat.group.manager.BusinessGroupServiceImpl.removeParticipants(BusinessGroupServiceImpl.java:1141)
      >>> stack of 3.cause::javax.persistence.OptimisticLockException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      -> at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:214)
         at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:88)
         at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
         at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:61)
         at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:71)
         at org.olat.core.commons.persistence.DBImpl.commit(DBImpl.java:548)
         at org.olat.core.commons.services.notifications.manager.NotificationsManagerImpl.subscribe(NotificationsManagerImpl.java:910)
         at org.olat.core.util.mail.manager.MailManagerImpl.subscribe(MailManagerImpl.java:210)
         at org.olat.core.util.mail.manager.MailManagerImpl.saveDBMessage(MailManagerImpl.java:1055)
         at org.olat.core.util.mail.manager.MailManagerImpl.sendMessage(MailManagerImpl.java:702)
         at org.olat.group.manager.BusinessGroupMailing.sendEmail(BusinessGroupMailing.java:146)
      >>> stack of 4.cause::org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      -> at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:67)
         at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:54)
         at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:46)
         at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3325)
         at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3562)
         at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:99)
         at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:589)
         at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)
         at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
         at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
         at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1437)
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              srosse Stéphane Rossé
              Tester:
              Mandy Menzel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 5 minutes
                3h 5m