I'm trying to figure out how to configure my project such that JPA will timeout and throw an exception after a configured amount of time. There are two situations where I would like this to happen:
I'm not sure if these two scenarios can be configured separately (a different timeout threshold for each), or if one threshold is used for both.
My project is currently set up as follows:
persistence.xml
configuration file (using Hibernate-specific property values only when necessary)JPA2 persistence property "javax.persistence.query.timeout" allows you to set the timeout for a query (assuming the underlying JDBC driver supports it).