[Building Sakai] Message Center Forums looping queries

Ashley Willis ashley_willis at unc.edu
Thu Feb 2 15:09:20 PST 2012


Update,
  So we have traced it to this change between 2.7.0 and 2.7.5:

DiscussionTopicBean.getAttachList()

In 2.7.5 the attachment list is built by calling forumManager which 
makes a db call to get attachments for each topic id.

List<Attachment> attachList = 
forumManager.getTopicAttachments(topic.getId());

We rolled this back to the 2.7.0 method of just getting the list from 
topic and the problem went away.
List<Attachment> attachList =  topic.getAttachments();

Still investigating but this seems to be the issue for us.

thanks,
Ashley Willis

Teaching and Learning Developer
University of North Carolina at Chapel Hil



On 2/2/12 4:49 PM, Ashley Willis wrote:
> We are running Sakai 2.7.0 msgcntr 2.7.5. We have noticed certain forums
> take several minutes to load in 2.7.5. The forum is not terribly large,
> roughly 6 forums with 13 topics per forum. The instructor creates a
> forum for each assignment and a topic for each student under each forum.
> Students typically just upload an attachment as a response to their
> topic as the assignment. What we have found is that this query is
> getting called thousands of times in a loop with different surrogateKeys
> which explains the long load times:
>
> select attachment0_.ID as ID65_, attachment0_.VERSION as VERSION65_,
> attachment0_.UUID as UUID65_,
> attachment0_.CREATED as CREATED65_, attachment0_.CREATED_BY as
> CREATED5_65_, attachment0_.MODIFIED
> as MODIFIED65_, attachment0_.MODIFIED_BY as MODIFIED7_65_,
> attachment0_.ATTACHMENT_ID as ATTACHMENT8_65_,
> attachment0_.ATTACHMENT_URL as ATTACHMENT9_65_,
> attachment0_.ATTACHMENT_NAME as ATTACHMENT10_65_,
> attachment0_.ATTACHMENT_SIZE as ATTACHMENT11_65_,
> attachment0_.ATTACHMENT_TYPE as ATTACHMENT12_65_,
> attachment0_.m_surrogateKey as m13_65_, attachment0_.of_surrogateKey as
> of14_65_, attachment0_.pf_surrogateKey
> as pf15_65_, attachment0_.t_surrogateKey as t16_65_ from
> MFR_ATTACHMENT_T attachment0_ where
> attachment0_.t_surrogateKey=403560
>
> On a whim, we rolled back to msgcntr to 2.7.0 and this doesn't happen,
> the forum loads in a reasonable time. We don't see this query being
> executed over and over.
>
> We're about to start comparing code unless some has the magic formula.
> Any takers?
>
> thanks in advance!
>
> ashley
>
> _______________________________________________
> 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/20120202/c3742b82/attachment.html 


More information about the sakai-dev mailing list