Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.1.4, 7.4.1, 8.0-milestone-1
-
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
- blocks
-
XAMEETINGS-122 Integration tests are broken
- Closed