Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3599

Hibernate issuing unnecessary DB delete/insert during item view

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.1
    • Component/s: None
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      9
    • Documentation Status:
      Not Required

      Description

      Problem:

      During item views, it appears Hibernate is issuing database-modifying SQL during what should be a read-only request. It removes the item in question from collection2item, then re-adds it. Then it removes the collection from the community2collection table, and re-adds it.

      Background:

      While debugging a strange issue for a recent 6.0 deployment, I turned on Hibernate logging and noticed messages like the following occurring in the DSpace log for each item view request:

      2017-05-17 10:09:31,893 DEBUG org.hibernate.SQL @ delete from public.collection2item where item_id=?
      2017-05-17 10:09:31,982 DEBUG org.hibernate.SQL @ insert into public.collection2item (item_id, collection_id) values (?, ?)
      2017-05-17 10:09:31,984 DEBUG org.hibernate.SQL @ delete from public.community2collection where collection_id=?
      2017-05-17 10:09:31,991 DEBUG org.hibernate.SQL @ insert into public.community2collection (collection_id, community_id) values (?, ?)

      To reproduce, install latest dspace-6_x branch, make sure the following are in your log4j.properties:

      log4j.logger.org.hibernate.SQL=DEBUG
      log4j.logger.org.hibernate.type=TRACE

      ...and view an item page. If you grep dspace's log for "insert into" or "delete from", you will see some messages like the above on each item page view.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cwilper Chris Wilper
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: