title: Could not initialize proxy - no Session
body: <p>I've got an error that looks like this:</p>
  
  <blockquote>
    <p>Could not initialize proxy - no Session</p>
  </blockquote>
  
  <p>I'm working with java, hibernate and spring. This error comes up when trying to generate a PDF document, and I'm following the next steps to generate it on the fly and store in the database.</p>
  
  <ol>
  <li><p>I sent a request to the app through a POST method. This generates the PDF on the fly and shows to the user.</p></li>
  <li><p>Just after that request I send another, but through an ajax a request. This will generate the same PDF but will save it in the DB.</p></li>
  </ol>
  
  <p>The error shows that a query could not be executed due to "could not initialize proxy - no Session" error.</p>
  
  <p>Is there something that am I doing wrong, calling the same methods twice from the same user session? Could it be that the session is closed before both requests have finished?</p>
  
  <p>Hope someone can help me to understand what is happening.</p>