Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13094

Corrupted context during mail preparation cause templated mails to not being sent to all recipients

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 8.0-milestone-2, 7.4.2
    • 7.1.4, 7.4.1, 8.0-milestone-1
    • Mail
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      During mail preparation, to provide to all mails an independent context, the context is cloned for each mail. The XWikiContext itself contains reference to the current Hibernate session and Hibernate transaction, and these get cleanup (rollback transaction) in the original context, but are kept closed in the cloned context. When the cloned context is used for an hibernate transaction, the state of the transaction is wrong, causing:

      Caused by: org.hibernate.SessionException: Session is closed!
      at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java)
      at org.hibernate.impl.SessionImpl.afterTransactionBegin(SessionImpl.java)
      at org.hibernate.jdbc.JDBCContext.afterTransactionBegin(JDBCContext.java)
      at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java)
      at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java)
      at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java)
      ...
      

      The hibernate session/transaction should be clean up before clone to prevent this issue.

      Attachments

        Issue Links

          Activity

            People

              softec Denis Gervalle
              softec Denis Gervalle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: