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");