title: How to cancel a running query in java persistence?
body: <p>My application runs using Persistence API, Hibernate and Spring. I am using MySql DB.
  There are some queries which might take a lot of time to compute, so I need a cancel button to cancel the execution of these queries.</p>
  
  <p>I found out that there is a memthod java.sql.statement.cancel() which is used to cancel a query, but this can be accesssed from the statement object, how to do this from the entityManager object in Java persistence ?</p>