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

Bryan Holladay holladay at longsight.com
Wed Mar 11 08:12:19 PDT 2015


That should be all you need... the jira you mentioned is a security jira
but it isn't the correct one anyways. Here's what you found:
https://jira.sakaiproject.org/browse/SAK-24821

On Wed, Mar 11, 2015 at 10:56 AM, Miller, Jeffrey <
jeffrey.miller.ctr at usuhs.edu> wrote:

> 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
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20150311/07928828/attachment.html 


More information about the sakai-dev mailing list