title: Oracle DB connection not closed on 504 timeout
body: <p>I am using spring/hibernate/oracle configuration in my web application.
  There are some queries that are executing quite long more then 2 minutes.
  The issue is that after 60 seconds I am getting 504 timout on the web UI which, on the end leaves the DB connection open.
  Do I need to close the connection explicitly on the timeout exception?
  I am using:</p>
  <pre><code>@PersistenceContext
  public transient EntityManager em;
  
  em.createQuery(&quot;select ...&quot;).getResultList();
  </code></pre>
  <p>And this is hibernate configuration:</p>
  <pre><code>&lt;Resource validationQuery=&quot;select 1 from dual&quot;
      logAbandoned=&quot;true&quot; removeAbandonedTimeout=&quot;600&quot; removeAbandoned=&quot;true&quot;
      maxWait=&quot;-1&quot; maxIdle=&quot;50&quot; maxActive=&quot;100&quot; password=&quot;xxx&quot;
      username=&quot;xxx&quot;
      url=&quot;jdbc:oracle:thin:XXXX&quot;
      driverClassName=&quot;oracle.jdbc.driver.OracleDriver&quot;
      type=&quot;javax.sql.DataSource&quot; auth=&quot;Container&quot; name=&quot;jdbc/xxx&quot; /&gt;
  </code></pre>
  <p>Thanks for the help</p>