问题
I am using Open JPA 2.0 - IBM implementation on WebSphere V8. I need to set query timeout at individual query level. How this can be achieved?
Using below hint will set timeout for all queries, but I need to control this for specific queries
javax.persistence.query.timeout
回答1:
Errm, perhaps ...
query.setHint("javax.persistence.query.timeout", timeout);
来源:https://stackoverflow.com/questions/13011829/jpa-query-timeout