[Building Sakai] Message Center (MSGCNTR) Hibernate Lazy Loading Problem

Miller, Jeffrey jeffrey.miller.ctr at usuhs.edu
Wed Mar 11 07:56:42 PDT 2015


I'm seeing the following stack trace in production (2.9.3):

2015-03-11 07:57:23,412  ERROR org.hibernate.LazyInitializationException -
failed to lazily initialize a collection of role:
org.sakaiproject.component.app.messageforums.dao.hibernate.TopicImpl.messagesSet,
no session or session was closed

org.hibernate.LazyInitializationException: failed to lazily initialize a
collection of role:
org.sakaiproject.component.app.messageforums.dao.hibernate.TopicImpl.messagesSet,
no session or session was closed

at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)

at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)

at
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)

at
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)

at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:163)

at
org.sakaiproject.component.app.messageforums.dao.hibernate.Util.setToList(Util.java:34)

at
org.sakaiproject.component.app.messageforums.dao.hibernate.TopicImpl.getMessages(TopicImpl.java:85)

at
org.sakaiproject.tool.messageforums.DiscussionForumTool.sendEmailNotification(DiscussionForumTool.java:8017)

at
org.sakaiproject.tool.messageforums.DiscussionForumTool.approveOrDenySelectedMsgs(DiscussionForumTool.java:5251)

at
org.sakaiproject.tool.messageforums.DiscussionForumTool.markCheckedAsApproved(DiscussionForumTool.java:5187)

I think I've narrowed down the problem to the following diff in
DiscussionForumTool.java:

Sakai 10
//MSGCNTR-741 need to filter out post first users
if (((DiscussionTopic)reply.getTopic()).getPostFirst()) {
    Topic topicWithMessages =
forumManager.getTopicByIdWithMessagesAndAttachments(reply.getTopic().getId());
    userlist.removeAll(getNeedToPostFirst(userlist,
(DiscussionTopic)reply.getTopic(), topicWithMessages.getMessages()));
}

Sakai 2.9.3
//MSGCNTR-741 need to filter out post first users
userlist.removeAll(getNeedToPostFirst(userlist,
(DiscussionTopic)reply.getTopic(), reply.getTopic().getMessages()));

Does this look reasonable as a patch?

I also tried to look up MSGCNTR-741 (and MSGCNTR-785 which might be
related) but didn't have privilege or some such thing. I'm having trouble
locating the Message Center (MSGCNTR) project. Did this project get merged
or relocated, or something?

Thanks,
-jeb


-- 
Jeb Miller
Programmer Analyst - Sakai, HJF
USUHS/ATD
4301 Jones Bridge Road
Bethesda, MD 20814-4799
301-319-0442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20150311/aec7c7fc/attachment.html 


More information about the sakai-dev mailing list