Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-36127

Hibernate logic error could result in higher DB activity

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 2.8.3, 2.9.0, 10.0
    • Fix Version/s: None
    • Labels:
    • Previous Issue Keys:
      SAM-1697

      Description

      In GradingService.storeGrades the 3rd save of the does the following (round l. 967):

      // save#3: itemGradingSet has been saved above so just need to update assessmentGrading
      // therefore setItemGradingSet as empty first - daisyf
      // however, if we do not persist to DB, we want to keep itemGradingSet with data for later use
      // Because if itemGradingSet is not saved to DB, we cannot go to DB to get it. We have to
      // get it through data.
      if (persistToDB) {
      data.setItemGradingSet(new HashSet());
      saveOrUpdateAssessmentGrading(data);
      log.debug("****x7. "+(new Date()).getTime())

      This is a misunderstanding of how hibernate should work and could cause deletes to cascade to the itemData table. As long as the hashcode and equals match already saved objects in the session the Hibernate won't update them. SAM-1615 should see to the hibernate objects in this area having properly implemented hashcodes and equals

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                dhorwitz David Horwitz
                Reporter:
                dhorwitz David Horwitz
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration