title: Is it possible to apply query timeout for native jpa query in Hibernate?
body: <p>For HQL query I can do the following:</p>
  
  <pre><code>    entityManager.createQuery("update UserSession set userAgent = ''")
              .setHint("org.hibernate.timeout", 1)
              .executeUpdate();
  </code></pre>
  
  <p>But if I do the same for native sql query timeout doesn't work</p>
  
  <pre><code>    entityManager.createNativeQuery("update user_session set user_agent = ''")
              .setHint("org.hibernate.timeout", 1)
              .executeUpdate();
  </code></pre>
  
  <p>Is it possible to apply timeout for native query ? </p>
  
  <p><strong>Note.</strong>
  Preventing possible questions like "Why do you need to update user_session table this way" let me note that in real life I need to execute very complex update query. For this topic exact query is not important.</p>