Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-3240

CrucibleRevisions created in a transaction are not visible (via a query on source, path and revision) later in that tx, because of the query cache

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.2.3, 2.3-M2, 2.3.0
    • 2.2.1, 2.3-M1
    • None
    • None

    Description

      when you create a patch review, the CrucibleRevisions are created in the same tx they are used. Because they are actually created in a separate session, the query cache isn't invalidated (at least, I'm sure the query cache is the problem, not sure that the separate session is the cause) so a later query gets the 'not found' response from the cache.

      This fixes the problem.

      Index: src/java/com/cenqua/crucible/model/managers/CarefulRevisionCreator.java
      ===================================================================
      --- src/java/com/cenqua/crucible/model/managers/CarefulRevisionCreator.java	(revision 57015)
      +++ src/java/com/cenqua/crucible/model/managers/CarefulRevisionCreator.java	(working copy)
      @@ -161,6 +162,8 @@
       
               Integer id = createRevisionWithSingletonSession(source, path, revision, revisionDisplayName, createDate);
       
      +        HibernateUtil.currentSession().getSessionFactory().evictQueries();
      +
               r = (CrucibleRevision) originalSession.get(CrucibleRevision.class, id);
               if (r == null) {
                   throw new IllegalStateException("Could not retrieve revision created on other transaction");
      
      

      Attachments

        Activity

          People

            tom@atlassian.com Tom Davies
            tom@atlassian.com Tom Davies
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: