title: Why am I getting a SpringFramework UnexpectedRollbackException?
body: <p>I am getting the following Spring Framework error message: </p>
  
  <pre><code>Invocation of getLogoForGlobalConext() in class $Proxy44 threw exception
  org.springframework.transaction.UnexpectedRollbackException:
  Transaction rolled back because it has been marked as rollback-only
  at template/includes/macros.vm line 1651, column 43
  </code></pre>
  
  <p>I opened <code>macros.vm</code> and looked up line 1651 and it looks like this:</p>
  
  <pre><code>#set ($globalLogo = $spaceManager.getLogoForGlobalContext());
  </code></pre>
  
  <p>From my research it looks like <code>$Proxy44</code> is actually the <code>$spaceManager</code> variable (or an instance of <code>DefaultSpaceManager.java</code>).  </p>
  
  <p>This message appears randomly and when the web app tries to download an image/attachment sitting somewhere on the web server / database.  </p>
  
  <p>The attachmentmanager is governed by Spring's Transaction Management and the following transaction attributes are used when an image/attachment is downloaded: </p>
  
  <ol>
  <li><p>propagation - for all methods in the attachment manager</p></li>
  <li><p>propagation and read-only - for all methods in attachment manager starting with "get".</p></li>
  </ol>
  
  <p>The attributes are defined in <a href="http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html" rel="nofollow noreferrer">Spring Framework - Chapter 9. Transaction management</a>.
  What I am thinking is I need to set a timeout on the transactions (like set it to infinity).</p>