Skip to content

Commit

Permalink
SAM-3325 avoid query count increasing as user advances through an ass…
Browse files Browse the repository at this point in the history
…essment (sakaiproject#5117)

* SAM-3325 avoid query count increasing as user advances through an assessment

* SAM-3325 do a Hibernate save if no student response has been created yet
  • Loading branch information
ottenhoff authored and ern committed Dec 15, 2017
1 parent 903be88 commit faba59b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1106,11 +1106,12 @@ public void saveOrUpdateAssessmentGrading(AssessmentGradingData assessment) {
int retryCount = persistenceHelper.getRetryCount();
while (retryCount > 0) {
try {
/* for testing the catch block - daisyf
if (retryCount >2)
throw new Exception("uncategorized SQLException for SQL []; SQL state [61000]; error code [60]; ORA-00060: deadlock detected while waiting for resource");
*/
getHibernateTemplate().saveOrUpdate((AssessmentGradingData) assessment);
if (assessment.getAssessmentGradingId() != null) {
getHibernateTemplate().merge((AssessmentGradingData) assessment);
}
else {
getHibernateTemplate().save((AssessmentGradingData) assessment);
}
retryCount = 0;
} catch (Exception e) {
log.warn("problem inserting/updating assessmentGrading: {}", e.getMessage());
Expand Down Expand Up @@ -1463,7 +1464,7 @@ public void saveOrUpdateAll(Collection<ItemGradingData> c) {
while (retryCount > 0) {
try {
for (ItemGradingData itemGradingData : c) {
getHibernateTemplate().saveOrUpdate(itemGradingData);
getHibernateTemplate().merge(itemGradingData);
}
retryCount = 0;
} catch (Exception e) {
Expand Down

0 comments on commit faba59b

Please sign in to comment.