title: spring.jpa.properties.javax.persistence.query.timeout not working for PostgreSQL
body: <p>I would like to have an option to limit all Spring jpa queries to a certain time limit. If a query takes longer than the specified limit it should be cancelled. From what I saw this can be achieved by using <code>javax.persistence.query.timeout</code> and since I am in a Spring context: </p>
  
  <pre><code>spring: 
    jpa:
      properties:
        javax.persistence.query.timeout: 10000
  </code></pre>
  
  <p>This should limit all queries executed from spring repositories to 30 seconds, but it's not working. This repository method takes 20 seconds:</p>
  
  <pre><code>@Query(value = "select count(*) from pg_sleep(20)", nativeQuery = true)
  int slowQuery();
  </code></pre>
  
  <p>I tried it with Postgresql 9.6.11 and with Postgresql 10.5. </p>
  
  <p>Is there some problem with these Postgres versions? Is there any other way to achieve the query execution timeout?</p>