Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2428

calling getUsersFromOrganisationByRole results in TransientDataAccessResourceException

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Monitor
    • Labels:
      None

      Description

      Open the add lesson wizard and click on the class tab. The spinny thing won't stop because there's an exception in the back -

      ERROR org.lamsfoundation.lams.workspace.web.WorkspaceAction - getUsersFromOrganisationByRole: Exception occured. organisationID 4 role MONITOR
      org.springframework.dao.TransientDataAccessResourceException: Hibernate flushing: Could not execute JDBC batch update; SQL [update lams_user set login=?, password=?, title=?, first_name=?, last_name=?, address_line_1=?, address_line_2=?, address_line_3=?, city=?, state=?, postcode=?, country=?, day_phone=?, evening_phone=?, mobile_phone=?, fax=?, email=?, disabled_flag=?, create_date=?, chat_id=?, enable_flash=?, workspace_id=?, authentication_method_id=?, flash_theme_id=?, html_theme_id=?, locale_id=?, timezone=?, portrait_uuid=?, change_password=?, lams_community_token=?, lams_community_username=?, tutorials_disabled=?, first_login=? where user_id=?]; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
              at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:106)
              at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
              at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
              at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
              at org.springframework.orm.hibernate3.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:801)
              at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:787)
              at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663)
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
              at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
              at org.lamsfoundation.lams.workspace.service.WorkspaceManagementService$$EnhancerByCGLIB$$d0a82430.getUsersFromOrganisationByRole(<generated>)
              at org.lamsfoundation.lams.workspace.web.WorkspaceAction.getUsersFromOrganisationByRole(WorkspaceAction.java:603)

      This is because in workspaceApplicationContext, get* methods are set readOnly. If there are no objections, we can simply remove this flag (we have no other readOnly transactions as I've seen).

        Activity

        Hide
        jundirl Jun-Dir Liew added a comment -
        A better fix is to remove the need for it to update lams_user - looks like the timezone field of User object is at fault (thanks Ernie)
        Show
        jundirl Jun-Dir Liew added a comment - A better fix is to remove the need for it to update lams_user - looks like the timezone field of User object is at fault (thanks Ernie)
        Hide
        ernieg Ernie Ghiglione added a comment -
        Tested and closed
        Show
        ernieg Ernie Ghiglione added a comment - Tested and closed

          People

          • Assignee:
            jundirl Jun-Dir Liew
            Reporter:
            jundirl Jun-Dir Liew
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development