Student matrices are sometimes stored multiple times in database

Description

There are reported cases from IU and LOI where the student's matrix is stored multiple times in the database. Because the code assumes there is only one matrix the the database (it reads the database and uses the first record that is returned) there can be strange behavior for users when viewing the matrix. Sometimes the content of one record is shown, sometimes the content of another record.

You can use the following query to identify if there are multiple matrix records in the DB:

select worksiteid, scaffolding_id, owner, count
from sakai.osp_matrix m
inner join sakai.osp_scaffolding s on s.id = m.scaffolding_id
group by worksiteid, scaffolding_id, owner
having count > 1
order by count DESC

The resolution is to remove all duplicate records and then put a constraint on the OSP_MATRIX table to make sure there can be only one matrix per student:

create unique index OSP_MATRIX_OWN_SCAFF_UK on OSP_MATRIX(OWNER, SCAFFOLDING_ID);

It's not yet known why there are duplicate records stored in the DB or how to reproduce this behavior.

Activity

Show:

Neal Caidin October 17, 2016 at 8:45 AM

OSP is no longer supported or part of Sakai. Closing related issues.

Won't Fix

Details

Priority

Affects versions

Components

Assignee

Reporter

Environment

Oracle DB

Created November 11, 2013 at 9:05 AM
Updated October 17, 2016 at 8:48 AM
Resolved October 17, 2016 at 8:45 AM